7 #ifndef __KVCLASSFACTORY_H
8 #define __KVCLASSFACTORY_H
122 const Char_t* templateFile);
177 return !strcmp(
GetAccess(),
"protected");
261 if (strcmp(defaultvalue,
"")) {
265 if (strcmp(argname,
"")) {
414 const Char_t* base_class =
416 kFALSE,
const Char_t* templateFile =
"");
419 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
427 const Char_t* base_class =
429 kFALSE,
const Char_t* templateFile =
"");
436 const Char_t* argument_name =
"",
const Char_t* default_value =
"",
const Char_t* access =
"public");
440 void AddMethod(
const KVClassMethod& kvcm);
442 const Char_t* argument_name =
"",
const Char_t* default_value =
"");
#define ClassDef(name, id)
char * Form(const char *fmt,...)
Base class for KaliVeda framework.
void SetLabel(const Char_t *lab)
const Char_t * GetLabel() const
virtual Bool_t IsCalled(const Char_t *name) const
Constructor for a class generated with KVClassFactory.
Bool_t IsDefaultCtor() const
void SetBaseClassArgument(Int_t i)
Bool_t IsCopyCtor() const
virtual Bool_t IsConstructor() const
void SetCopyCtor(Bool_t c=kTRUE)
virtual void write_method_body(KVString &decl)
KVClassConstructor(KVClassFactory *ParentClass)
KVClassFactory * fParentClass
void SetMemberVariableNameForArgument(Int_t i, const Char_t *memvar)
virtual ~KVClassConstructor()
Destructor for a class generated with KVClassFactory.
virtual ~KVClassDestructor()
virtual Bool_t IsDestructor() const
Member variable in a class generated with KVClassFactory.
virtual void WriteDeclaration(KVString &)
Write declaration in the KVString object.
void SetComment(const Char_t *c)
set comment for variable
void Print(Option_t *="") const
print the KVClass member
void SetAccess(const Char_t *acc="public")
set access type : public, protected or private
const Char_t * GetRealName() const
get short name without leading 'f'
const Char_t * GetComment() const
get access type : public, protected or private
const Char_t * GetAccess() const
get access type : public, protected or private
Bool_t IsProtected() const
void Copy(TObject &obj) const
copy this to obj
Method in a class generated with KVClassFactory.
virtual void write_method_body(KVString &decl)
void SetMethodComment(const KVString &com)
void Print(Option_t *="") const
print the KVClass method
const Char_t * GetReturnType()
KVClassMethod(Bool_t Virtual=kFALSE, Bool_t Const=kFALSE, Bool_t Inline=kFALSE)
virtual Bool_t IsDestructor() const
void SetConst(Bool_t c=kTRUE)
void WriteImplementation(KVString &decl)
void SetBaseClass(const Char_t *name)
void Copy(TObject &obj) const
copy this to obj
void WriteDeclaration(KVString &)
virtual Bool_t IsConstructor() const
void AddArgument(const Char_t *type, const Char_t *argname="", const Char_t *defaultvalue="")
void SetReturnType(const Char_t *type)
const Char_t * GetClassName()
void SetClassName(const Char_t *name)
void SetVirtual(Bool_t c=kTRUE)
Bool_t IsNormalMethod() const
void SetInline(Bool_t yes=kTRUE)
void SetMethodBody(const KVString &body)
Factory class for generating skeleton files for new classes.
void Print(Option_t *opt="") const
Print infos on object.
void SetOutputPath(const KVString &p)
Bool_t fInlineAllCtors
kTRUE if all ctor implementations written in header
void WriteWhoWhen(std::ofstream &)
const Char_t * GetClassDesc() const
Bool_t WithMultipleBaseClasses() const
void SetTemplate(Bool_t temp, const Char_t *temp_file)
KVList fMembers
list of member variables for class
Bool_t fInlineAllMethods
kTRUE if all (non-ctor) method implementations written in header
void AddMethodComment(const Char_t *method_name, const KVString &comment)
Set the comments for method 'method_name' added to the class using AddMethod.
void WriteClassWithTemplateImp()
Writes the implementation file for the class.
KVString fTemplateClassName
name of template dummy class
Bool_t IsBaseClassTObject() const
void GenerateGettersAndSetters()
virtual ~KVClassFactory()
KVList fMethods
list of methods added to class
void AddTObjectCopyMethod()
void GenerateCode()
Generate header and implementation file for currently-defined class.
TDatime fNow
for dating files
KVClassMethod * GetMethod(const Char_t *name) const
const Char_t * GetTemplateBase() const
Bool_t fHasBaseClass
kTRUE if class derived from another
void SetClassName(const Char_t *n)
void SetInheritAllConstructors(Bool_t yes=kTRUE)
const Char_t * GetImpFileName() const
const KVList * GetListOfMethods() const
KVString fTemplateCPP
full path to template .cpp
const KVList * GetListOfMembers() const
void AddMemberInitialiserConstructor(KVClassConstructor *=nullptr)
TClass * fBaseClass
description of base class
Bool_t WithTemplate() const
void WriteClassHeader()
Write the class header file.
KVString fClassDesc
class description
Bool_t fInheritAllCtors
kTRUE if all ctor from base class should be inherited
const Char_t * GetHeaderFileName() const
KVClassFactory()
Default ctor.
KVString fClassPath
directory in which to write source files, if not working directory
KVClassConstructor * GetDefaultCtor() const
static void MakeClass(const Char_t *classname, const Char_t *classdesc, const Char_t *base_class="", Bool_t withTemplate=kFALSE, const Char_t *templateFile="")
void AddHeaderIncludeFile(const Char_t *filename)
void Copy(TObject &obj) const
Copy the state of this KVClassFactory to the one referenced by 'obj'.
void AddDestructor(const TString &access="public")
Add default destructor to class.
void WriteClassDec(std::ofstream &)
void AddImplIncludeFile(const Char_t *filename)
KVString fTemplateH
full path to template .h
KVString fBaseClassName
name of base class
Bool_t CheckTemplateFiles(const Char_t *base_class, const Char_t *templateFile)
void AddDefaultConstructor()
const Char_t * GetClassName() const
void SetClassDesc(const Char_t *d)
void AddCopyConstructor()
void WritePreProc(std::ofstream &)
Int_t GetNumberOfMemberVariables() const
void AddMethodBody(const Char_t *method_name, const KVString &body)
Ssiz_t FindNextUncommentedLine(TString &, Ssiz_t beg=0)
const Char_t * GetBaseClass() const
void WriteClassWithTemplateHeader()
void AddAssignmentOperator()
void InlineAllMethods(bool yes=true)
const Char_t * GetOutputPath() const
Bool_t fBaseClassTObject
kTRUE if class derived from TObject
KVList fHeadInc
list of 'includes' to be added to header file
KVString fTemplateBase
template base name passed to SetTemplate method
void AddMethodArgument(const Char_t *method_name, const Char_t *argument_type, const Char_t *argument_name="", const Char_t *default_value="")
void InlineAllConstructors(bool yes=true)
KVString fClassName
name of class to generate
KVClassDestructor * GetDestructor() const
void SetBaseClass(const Char_t *b)
void AddGetSetMethods(const KVNameValueList &)
For each named parameter in the list, we add protected member variables with the name and type of the...
Bool_t fWithTemplate
true if class has a template
KVClassConstructor * AddConstructor(const Char_t *argument_type="", const Char_t *argument_name="", const Char_t *default_value="", const Char_t *access="public")
KVClassMember * AddMember(const Char_t *name, const Char_t *type, const Char_t *comment, const Char_t *access="protected")
KVString fAuthor
user who called ClassFactory to generate class
KVList fImpInc
list of 'includes' to be added to implementation file
void AddAllBaseConstructors()
KVClassMethod * AddMethod(const Char_t *name, const Char_t *return_type, const Char_t *access="public", Bool_t isVirtual=kFALSE, Bool_t isConst=kFALSE)
Extended TList class which owns its objects by default.
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
const Char_t * GetStringValue(const Char_t *name) const
Bool_t HasParameter(const Char_t *name) const
T * get_object(const TString &name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
static TClass * GetClass(Bool_t load=kTRUE, Bool_t silent=kFALSE)
Bool_t InheritsFrom(const char *cl) const
virtual Int_t GetEntries() const
virtual void SetName(const char *name)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
TString & Append(char c, Ssiz_t rep=1)
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const