In file modules/TclObjectKind.h:

class TclObjectKind : public AutoLink< TclObjectKind >, public EmptyObjectsList<TclObject>

A TCL object descriptor

Inheritance:


Public Methods

void deleteAllObjects (void)
delete any object of that kind
const char* getName (void) const
returns item name
const char* getRealName (void) const
returns item real name
void newOption (char *name, int (TclObject::*cmd)(int argc, char **argv), const char *synopsis = 0, const char *description = 0)
adds a new option to this command
TclModule* getModule (void) const
returns module
void setModule (TclModule *m)
set new module
std::map < char *, CommandOption *, CStringCompare > * getOptions (void)
get options map
unsigned int getNextRef (void) const
returns ref of next object to be created
int(*getCommand(void)) (TclObject *, Tcl_Interp*, int, char **)
get command function associated to this object
void setCommand (int (*cmd)(TclObject *, Tcl_Interp*, int, char **))
set a new command function for this object
void setNewSynopsis (const char *synopsis)
set new command synopsis
ObjectsList <TclObject> ::iterator firstObject (void) const
returns iterator on first object
ObjectsList <TclObject> ::iterator lastObject (void) const
returns iterator on last object
TclObject* getFirstObject (void) const
returns objects list first element
TclObject* getLastObject (void) const
returns objects list last element
void warnMe (WarnedObject *me)
adds 'me' to list of object to warn when list is empty
void doNotWarnMe (WarnedObject *me)
removes 'me' from list of object to warn when list is empty
virtual void empty (void) const
objects list gets empty callback function
static TclObject* getObject (const std::type_info &type, unsigned int n)
returns object with reference n (or 0 if it does not exist)
static TclObject* getObject (TclString name)
returns object (or 0 if it does not exist)
static TclObject* getObject (const std::type_info &type, int argc, char **argv, int i = 1)
returns object whose name is in argv[i] (or 0 if it does no exist)
static const char* getObjectName (const std::type_info &type)
returns given type object name
static TclObjectKind* findByKind (const std::type_info& type)
retrieve TclObjectKind object for objects with given type
static TclObjectKind* findByName (const char *name)
retrieve TclObjectKind object for objects with given name
static int newCmd (TclModule *m, int argc, char **argv)
TCL new command
static int whichCmd (TclModule *m, int argc, char **argv)
TCL which command
void addOptions (const std::type_info& src)
adds options from TclObject class whose type is given to this class

Public

exception class
constructor
TclObjectKind (TclModule *module, const std::type_info& type, const char *name, int (*createFromArgs)(TclModule *, int, char **), int (*objectsList)(TclModule *, int, char **), const char *synopsis = 0) throw(InvalidParameters)
creates a new object kind
TclObjectKind (TclModule *module, const std::type_info& type, const char *name, const char *realName, int (*createFromArgs)(TclModule *, int, char **), int (*objectsList)(TclModule *, int, char **), const char *synopsis = 0) throw(InvalidParameters)
creates a new object kind
destructor
~TclObjectKind ()
removes any warn and objects of that kind

Protected Fields

const char* name
object name
const char* realName
object real name i.e. name that can be unsderstood by the user
std::map < char *, CommandOption *, CStringCompare > options
hashtable with (char *) keys and (int (T::*)(int, char **)) values
TclModule* module
class module
ObjectsList <TclObject> objects
objects of that kind list
const std::type_info& objectsType
that object kind id
std::list <WarnedObject *> warn
objects to warn when list get empty
TclString newSynopsis
new operator command synopsis

Protected Methods

int(*createFromArgs) (TclModule *, int, char **)
pointer on a creation function
int(*objectsList) (TclModule *, int, char **)
pointer on a function returning a list of this kind objects
int(*globalCommand) (TclObject *, Tcl_Interp*, int, char **)
TCL global command (if any)
void operator+= (TclObject *obj)
add a TclObject to objects list
void operator-= (TclObject *obj) throw(ObjectsList<TclObject>::NotFound)
removes a TclObject from objects list
void created (TclObject *obj)
an object of that kind is being created
void deleted (TclObject *obj)
an object of that kind is being deleted

Documentation

A TCL object descriptor
const char* name
object name

const char* realName
object real name i.e. name that can be unsderstood by the user

int (*createFromArgs)(TclModule *, int, char **)
pointer on a creation function

int (*objectsList)(TclModule *, int, char **)
pointer on a function returning a list of this kind objects

int (*globalCommand)(TclObject *, Tcl_Interp*, int, char **)
TCL global command (if any)

std::map < char *, CommandOption *, CStringCompare > options
hashtable with (char *) keys and (int (T::*)(int, char **)) values

TclModule* module
class module

ObjectsList <TclObject> objects
objects of that kind list

const std::type_info& objectsType
that object kind id

std::list <WarnedObject *> warn
objects to warn when list get empty

TclString newSynopsis
new operator command synopsis

void operator+=(TclObject *obj)
add a TclObject to objects list
Parameters:
obj - object whose type should be typeid

void operator-=(TclObject *obj) throw(ObjectsList<TclObject>::NotFound)
removes a TclObject from objects list
Parameters:
obj - object whose type should be typeid

void created(TclObject *obj)
an object of that kind is being created
Parameters:
obj - object being created

void deleted(TclObject *obj)
an object of that kind is being deleted
Parameters:
obj - object being deleted

exception class

constructor

TclObjectKind(TclModule *module, const std::type_info& type, const char *name, int (*createFromArgs)(TclModule *, int, char **), int (*objectsList)(TclModule *, int, char **), const char *synopsis = 0) throw(InvalidParameters)
creates a new object kind
Throws:
InvalidParameter no argument may be 0
Parameters:
module - module creating this ObjectKind
type - typeid describing objects of that kind dynamic type
name - kind name
createFromArgs - pointer on an object creation function
listObjects - pointer on a function returning a list of this kind objects
synopsis - new command synopsis

TclObjectKind(TclModule *module, const std::type_info& type, const char *name, const char *realName, int (*createFromArgs)(TclModule *, int, char **), int (*objectsList)(TclModule *, int, char **), const char *synopsis = 0) throw(InvalidParameters)
creates a new object kind
Throws:
InvalidParameter no argument may be 0
Parameters:
module - module creating this ObjectKind
type - typeid describing objects of that kind dynamic type
name - kind name
realName - kind real name ie that can be understood by the user
createFromArgs - pointer on an object creation function
listObjects - pointer on a function returning a list of this kind objects
synopsis - new command synopsis

destructor

~TclObjectKind()
removes any warn and objects of that kind

void deleteAllObjects(void)
delete any object of that kind

const char* getName(void) const
returns item name

const char* getRealName(void) const
returns item real name

void newOption(char *name, int (TclObject::*cmd)(int argc, char **argv), const char *synopsis = 0, const char *description = 0)
adds a new option to this command
Parameters:
name - option name
cmd - command option callback method
synopsis - option synopsis
description - option description

TclModule* getModule(void) const
returns module

void setModule(TclModule *m)
set new module

std::map < char *, CommandOption *, CStringCompare > * getOptions(void)
get options map

unsigned int getNextRef(void) const
returns ref of next object to be created

int (*getCommand(void))(TclObject *, Tcl_Interp*, int, char **)
get command function associated to this object

void setCommand(int (*cmd)(TclObject *, Tcl_Interp*, int, char **))
set a new command function for this object

void setNewSynopsis(const char *synopsis)
set new command synopsis

ObjectsList <TclObject> ::iterator firstObject(void) const
returns iterator on first object

ObjectsList <TclObject> ::iterator lastObject(void) const
returns iterator on last object

TclObject* getFirstObject(void) const
returns objects list first element

TclObject* getLastObject(void) const
returns objects list last element

void warnMe(WarnedObject *me)
adds 'me' to list of object to warn when list is empty
Parameters:
me - object to warn

void doNotWarnMe(WarnedObject *me)
removes 'me' from list of object to warn when list is empty
Parameters:
me - object to warn

virtual void empty(void) const
objects list gets empty callback function

static TclObject* getObject(const std::type_info &type, unsigned int n)
returns object with reference n (or 0 if it does not exist)
Parameters:
type - object type
n - object reference

static TclObject* getObject(TclString name)
returns object (or 0 if it does not exist)
Parameters:
name - object name

static TclObject* getObject(const std::type_info &type, int argc, char **argv, int i = 1)
returns object whose name is in argv[i] (or 0 if it does no exist). If module is not 0, a message is displayed in TCL interpretor
Parameters:
type - object type
argc - number of arguments
argv - aruments
i - argument index supposed to name a TCL object

static const char* getObjectName(const std::type_info &type)
returns given type object name
Parameters:
type - wanted object type

static TclObjectKind* findByKind(const std::type_info& type)
retrieve TclObjectKind object for objects with given type

static TclObjectKind* findByName(const char *name)
retrieve TclObjectKind object for objects with given name

static int newCmd(TclModule *m, int argc, char **argv)
TCL new command

static int whichCmd(TclModule *m, int argc, char **argv)
TCL which command

void addOptions(const std::type_info& src)
adds options from TclObject class whose type is given to this class
Parameters:
src - source class


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de