7#ifndef __KVCLASSFACTORY_H
8#define __KVCLASSFACTORY_H
14#include "KVNameValueList.h"
123 const Char_t* templateFile);
179 return !strcmp(
GetAccess(),
"protected");
264 if (strcmp(defaultvalue,
"")) {
268 if (strcmp(argname,
"")) {
419 const Char_t* base_class =
421 kFALSE,
const Char_t* templateFile =
"");
424#if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
432 const Char_t* base_class =
434 kFALSE,
const Char_t* templateFile =
"");
441 const Char_t* argument_name =
"",
const Char_t* default_value =
"",
const Char_t* access =
"public");
445 void AddMethod(
const KVClassMethod& kvcm);
447 const Char_t* argument_name =
"",
const Char_t* default_value =
"");
#define ClassDef(name, id)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char * Form(const char *fmt,...)
Base class for KaliVeda framework.
void SetLabel(const Char_t *lab)
virtual Bool_t IsCalled(const Char_t *name) const
const Char_t * GetLabel() 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.
const Char_t * GetRealName() const
get short name without leading 'f'
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 * 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)
const Char_t * GetReturnType()
void Print(Option_t *="") const
print the KVClass method
const Char_t * GetClassName()
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)
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 &)
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
const Char_t * GetOutputPath() const
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()
const Char_t * GetBaseClass() const
virtual ~KVClassFactory()
const Char_t * GetClassName() const
const Char_t * GetClassDesc() const
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
Bool_t fHasBaseClass
kTRUE if class derived from another
void SetClassName(const Char_t *n)
void SetInheritAllConstructors(Bool_t yes=kTRUE)
const KVList * GetListOfMethods() const
KVString fTemplateCPP
full path to template .cpp
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
KVClassFactory()
Default ctor.
KVString fClassPath
directory in which to write source files, if not working directory
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
KVClassConstructor * GetDefaultCtor() const
Bool_t CheckTemplateFiles(const Char_t *base_class, const Char_t *templateFile)
const Char_t * GetHeaderFileName() const
void AddDefaultConstructor()
void SetClassDesc(const Char_t *d)
const Char_t * GetImpFileName() const
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)
KVClassMethod * GetMethod(const Char_t *name) const
void WriteClassWithTemplateHeader()
const Char_t * GetTemplateBase() const
void AddAssignmentOperator()
void InlineAllMethods(bool yes=true)
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="")
const KVList * GetListOfMembers() const
void InlineAllConstructors(bool yes=true)
KVString fClassName
name of class to generate
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...
KVClassDestructor * GetDestructor() const
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....
Bool_t InheritsFrom(const char *cl) const override
virtual Int_t GetEntries() const
virtual void SetName(const char *name)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
const char * Data() const
TString & Append(char c, Ssiz_t rep=1)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const