Entity_cpp.sh 871 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh

cat << EOF > ${PLUGIN_NAME}${ENTITY_NAME}.cpp
/*
 * ${PLUGIN_NAME}${ENTITY_NAME}.cpp
 *
 *  Created on: ${DATE}
 *      Author: ${AUTHOR}
 */

#include "${PLUGIN_NAME}${ENTITY_NAME}.h"

${PLUGIN_NAME}${ENTITY_NAME}::${PLUGIN_NAME}${ENTITY_NAME}() {
  /* 
	 *  TODO
	 *  Init attributes
	 */
	 
	_strand = nullptr;
}

${PLUGIN_NAME}${ENTITY_NAME}::~${PLUGIN_NAME}${ENTITY_NAME}() {
  /* 
	 *  TODO
	 *  Tear down attributes
	 */
	 
	if (_strand) {
		delete _strand;
	}
}

/* 
 *  TODO
 *  Implement own methods
 */

void ${PLUGIN_NAME}${ENTITY_NAME}::initializeStrand(boost::asio::io_service& io) {
	if (!_strand) {
		_strand = new boost::asio::io_service::strand(io);
	}
}

void ${PLUGIN_NAME}${ENTITY_NAME}::printConfig(LOG_LEVEL ll) {
  /*
   *  TODO
   *  Log attributes here for debug reasons
   */
  LOG_VAR(ll) << "   NumSpacesAsIndention: " << 3;
}
EOF