umbrello/umbrello
#include <cppcodegenerationpolicy.h>
Public Member Functions | |
CPPCodeGenerationPolicy () | |
virtual | ~CPPCodeGenerationPolicy () |
CodeGenerationPolicyPage * | createPage (QWidget *parent=0, const char *name=0) |
bool | getAccessorsAreInline () |
bool | getAccessorsArePublic () |
bool | getAutoGenerateAccessors () |
bool | getDestructorsAreVirtual () |
QString | getDocToolTag () |
QString | getObjectMethodInit (const QString &variableName="", const QString &itemClassName="") |
bool | getOperationsAreInline () |
bool | getPackageIsNamespace () |
QString | getStringClassName () |
QString | getStringClassNameInclude () |
QString | getVectorClassName () |
QString | getVectorClassNameInclude () |
QString | getVectorMethodAppend (const QString &variableName="", const QString &itemClassName="") |
QString | getVectorMethodInit (const QString &variableName="", const QString &itemClassName="") |
QString | getVectorMethodRemove (const QString &variableName="", const QString &itemClassName="") |
void | setAccessorsAreInline (bool var) |
void | setAccessorsArePublic (bool var) |
void | setAutoGenerateAccessors (bool var) |
virtual void | setDefaults (CPPCodeGenerationPolicy *cppclone, bool emitUpdateSignal=true) |
virtual void | setDefaults (bool emitUpdateSignal=true) |
void | setDestructorsAreVirtual (bool var) |
void | setDocToolTag (const QString &value) |
void | setOperationsAreInline (bool var) |
void | setPackageIsNamespace (bool var) |
void | setStringClassName (const QString &value) |
void | setStringClassNameInclude (const QString &value) |
void | setStringIncludeIsGlobal (bool value) |
void | setVectorClassName (const QString &value) |
void | setVectorClassNameInclude (const QString &value) |
void | setVectorIncludeIsGlobal (bool value) |
bool | stringIncludeIsGlobal () |
bool | vectorIncludeIsGlobal () |
Public Member Functions inherited from CodeGenPolicyExt | |
CodeGenPolicyExt () | |
virtual | ~CodeGenPolicyExt () |
Static Public Attributes | |
static const char * | DEFAULT_OBJECT_METHOD_INIT = "%VARNAME% = new %ITEMCLASS%();" |
static const char * | DEFAULT_VECTOR_METHOD_APPEND = "%VARNAME%.push_back(value);" |
static const char * | DEFAULT_VECTOR_METHOD_INIT = "" |
static const char * | DEFAULT_VECTOR_METHOD_REMOVE = "int size = %VARNAME%.size();\nfor (int i = 0; i < size; ++i) {\n\t%ITEMCLASS% item = %VARNAME%.at(i);\n\tif(item == value) {\n\t\tvector<%ITEMCLASS%>::iterator it = %VARNAME%.begin() + i;\n\t\t%VARNAME%.erase(it);\n\t\treturn;\n\t}\n }" |
Protected Member Functions | |
void | init () |
Detailed Description
Definition at line 23 of file cppcodegenerationpolicy.h.
Constructor & Destructor Documentation
CPPCodeGenerationPolicy::CPPCodeGenerationPolicy | ( | ) |
Constructor.
Definition at line 35 of file cppcodegenerationpolicy.cpp.
|
virtual |
Destructor.
Definition at line 43 of file cppcodegenerationpolicy.cpp.
Member Function Documentation
|
virtual |
Create a new dialog interface for this object.
- Parameters
-
parent the parent widget name the name of the page
- Returns
- dialog object
Implements CodeGenPolicyExt.
Definition at line 380 of file cppcodegenerationpolicy.cpp.
bool CPPCodeGenerationPolicy::getAccessorsAreInline | ( | ) |
Get the value of m_inlineAccessors.
- Returns
- the boolean value of m_inlineAccessors
Definition at line 81 of file cppcodegenerationpolicy.cpp.
bool CPPCodeGenerationPolicy::getAccessorsArePublic | ( | ) |
Get the value of m_publicAccessors.
- Returns
- the boolean value of m_publicAccessors
Definition at line 62 of file cppcodegenerationpolicy.cpp.
bool CPPCodeGenerationPolicy::getAutoGenerateAccessors | ( | ) |
Get the value of m_autoGenerateAccessors.
- Returns
- the boolean value of m_autoGenerateAccessors
Definition at line 157 of file cppcodegenerationpolicy.cpp.
bool CPPCodeGenerationPolicy::getDestructorsAreVirtual | ( | ) |
Get the value of m_virtualDestructors.
- Returns
- the boolean value of m_virtualDestructors
Definition at line 119 of file cppcodegenerationpolicy.cpp.
QString CPPCodeGenerationPolicy::getDocToolTag | ( | ) |
Definition at line 212 of file cppcodegenerationpolicy.cpp.
QString CPPCodeGenerationPolicy::getObjectMethodInit | ( | const QString & | variableName = "" , |
const QString & | itemClassName = "" |
||
) |
Be somewhat flexible about how new object classes are initialized.
Not sure if this should be user configureable. For now, it is not.
- Parameters
-
variableName variable name itemClassName item class name
- Returns
- object method init string
Definition at line 295 of file cppcodegenerationpolicy.cpp.
bool CPPCodeGenerationPolicy::getOperationsAreInline | ( | ) |
Get the value of m_inlineOperations.
- Returns
- the boolean value of m_inlineOperations
Definition at line 100 of file cppcodegenerationpolicy.cpp.
bool CPPCodeGenerationPolicy::getPackageIsNamespace | ( | ) |
Get the value of m_packageIsNamespace.
- Returns
- the boolean value of m_packageIsNamespace
Definition at line 138 of file cppcodegenerationpolicy.cpp.
QString CPPCodeGenerationPolicy::getStringClassName | ( | ) |
Definition at line 162 of file cppcodegenerationpolicy.cpp.
QString CPPCodeGenerationPolicy::getStringClassNameInclude | ( | ) |
Definition at line 167 of file cppcodegenerationpolicy.cpp.
QString CPPCodeGenerationPolicy::getVectorClassName | ( | ) |
Definition at line 172 of file cppcodegenerationpolicy.cpp.
QString CPPCodeGenerationPolicy::getVectorClassNameInclude | ( | ) |
Definition at line 177 of file cppcodegenerationpolicy.cpp.
QString CPPCodeGenerationPolicy::getVectorMethodAppend | ( | const QString & | variableName = "" , |
const QString & | itemClassName = "" |
||
) |
More flexible generation.
We want to allow the user to specify how the bodies of the vector methods should be auto-generated.
Definition at line 255 of file cppcodegenerationpolicy.cpp.
QString CPPCodeGenerationPolicy::getVectorMethodInit | ( | const QString & | variableName = "" , |
const QString & | itemClassName = "" |
||
) |
Definition at line 277 of file cppcodegenerationpolicy.cpp.
QString CPPCodeGenerationPolicy::getVectorMethodRemove | ( | const QString & | variableName = "" , |
const QString & | itemClassName = "" |
||
) |
Definition at line 266 of file cppcodegenerationpolicy.cpp.
|
protected |
Initialisation routine.
Definition at line 388 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setAccessorsAreInline | ( | bool | var | ) |
Set the value of m_inlineAccessors.
- Parameters
-
var the new value
Definition at line 71 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setAccessorsArePublic | ( | bool | var | ) |
Set the value of publicAccessors.
- Parameters
-
var the new value
Definition at line 51 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setAutoGenerateAccessors | ( | bool | var | ) |
Set the value of m_autoGenerateAccessors.
- Parameters
-
var the new value
Definition at line 147 of file cppcodegenerationpolicy.cpp.
|
virtual |
Set the defaults for this code generator from the passed generator.
- Parameters
-
cppclone code generation policy object for cloning emitUpdateSignal flag whether to emit update signal
Definition at line 311 of file cppcodegenerationpolicy.cpp.
|
virtual |
Set the defaults from a config file for this code generator from the passed KConfig pointer.
- Parameters
-
emitUpdateSignal flag whether to emit update signal
Implements CodeGenPolicyExt.
Definition at line 345 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setDestructorsAreVirtual | ( | bool | var | ) |
Set the value of m_virtualDestructors.
- Parameters
-
var the new value
Definition at line 109 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setDocToolTag | ( | const QString & | value | ) |
Definition at line 206 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setOperationsAreInline | ( | bool | var | ) |
Set the value of m_inlineOperations.
- Parameters
-
var the new value
Definition at line 90 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setPackageIsNamespace | ( | bool | var | ) |
Set the value of m_packageIsNamespace.
- Parameters
-
var the new value
Definition at line 128 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setStringClassName | ( | const QString & | value | ) |
We want to be flexible about which classes are allowed for generation of the CPP code.
In the next 4 method pairs, we give accessors that allow setting and getting the names of the classes, and their include files for string and vectors.
Definition at line 182 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setStringClassNameInclude | ( | const QString & | value | ) |
Definition at line 188 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setStringIncludeIsGlobal | ( | bool | value | ) |
Set flag whether string include is global.
- Parameters
-
value the value of the flag
Definition at line 239 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setVectorClassName | ( | const QString & | value | ) |
Definition at line 194 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setVectorClassNameInclude | ( | const QString & | value | ) |
Definition at line 200 of file cppcodegenerationpolicy.cpp.
void CPPCodeGenerationPolicy::setVectorIncludeIsGlobal | ( | bool | value | ) |
Set flag whether vector include is global.
- Parameters
-
value the value of the flag
Definition at line 249 of file cppcodegenerationpolicy.cpp.
bool CPPCodeGenerationPolicy::stringIncludeIsGlobal | ( | ) |
Determine if the string include is global.
- Returns
- value of flag
Definition at line 221 of file cppcodegenerationpolicy.cpp.
bool CPPCodeGenerationPolicy::vectorIncludeIsGlobal | ( | ) |
Determine if the vector include is global.
- Returns
- value of flag
Definition at line 230 of file cppcodegenerationpolicy.cpp.
Member Data Documentation
|
static |
Definition at line 31 of file cppcodegenerationpolicy.h.
|
static |
Definition at line 28 of file cppcodegenerationpolicy.h.
|
static |
Definition at line 30 of file cppcodegenerationpolicy.h.
|
static |
Definition at line 29 of file cppcodegenerationpolicy.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.