#include <stdobject.h>
Inheritance diagram for stdui::stdobject:


Public Types | |
| typedef std::list< stdobject * > | list |
| typedef stdobject::list::iterator | iterator |
| typedef stdobject::list::const_iterator | const_iterator |
Public Member Functions | |
| stdobject () | |
| default empty contructor. Initialize sensible data to default values. | |
| stdobject (stdobject *__parentobj, const std::string &nameid="undef", stdflags __flags=0) | |
| common contructor that initialize the object with provided values. | |
| template<class T> | |
| int | parent_chain (std::list< T * > &l) |
| returns all parent objects of type T into a std::list given as the argument l | |
| template<class T> | |
| T * | parentof () |
| Returns the first occurence of this object's parent of type T from the object's parent chain. | |
| template<class T> | |
| int | childrenof (std::list< T > &l) |
| returns all children object of type T into a std::list given as the argument l | |
| template<class T> | |
| T * | firstchildof () |
| Returns the first occurence of the object of type T into the object's children list. | |
| template<class T> | |
| T * | nextchildof () |
| Returns the next occurence of the object of type T from the object's children list, since the last call of std::object::firstchildof(). | |
| template<class T> | |
| T * | lastchildof () |
| Returns the last occurence of the object of type T into the object children list. | |
| virtual | ~stdobject () |
| int | addchild (stdobject *_obj) |
| Simply add ( or links ) a child opbject into the end of the children list. | |
| stdobject * | parent () |
| Returns the address of the immediate parent object as a stdobject class object. | |
| int | destroy_children () |
| Recusively destroy and delete the children objects. | |
| int | setparent (stdobject *_obj) |
| Set this object's parent to _obj. | |
| sigc::signal< bool, stdobject * > & | destroy_signal () |
| return ( expose ) the instance of the stdobject's destroy signal to be used for connecting a client slot. | |
| const std::string & | classname () const |
| return the classname. | |
| const std::string & | name () const |
| return the object's name. | |
| sigc::signal< bool, stdobject * >::iterator | destroy_delegate (const sigc::slot< bool, stdobject * > &_slot) |
| pthread_t | threadid () |
| just returns the thread id .... | |
| int | postevent (stdmessage msg) |
Protected Member Functions | |
| void | purgemessages () |
| virtual evt::result | messageevent (cmessageevent *mes) |
| virtual evt::result | keyevent (ckeypressevent *kev) |
| virtual evt::result | mouseevent (cmouseevent *mev) |
Protected Attributes | |
| stdobject * | _parent |
| Pointer to the parent object. | |
| sigc::signal< bool, stdobject * > | destroy_ |
| sigc::signal object that holds slots to be iterated during deletion of this object. | |
| stdobject::list | _children |
| std::list container for the immeditate children. | |
| list | _parents |
| parents list built upon the creation of this object. -- not yet used. | |
| std::string | _clsname |
| explicite class name of the object. ( avoiding using std::typeinfo for gcc which mangle the classnames... | |
| std::string | _name |
| Object's name. | |
Private Member Functions | |
| bool | _destroy (stdobject *o) |
Private Attributes | |
| stdflag | _flags |
| Object's current states and flags. | |
| list::iterator | _tpl_it |
| Persistent children iterator used to save current position into the childrfen list. | |
| pthread_t | _thid |
| std::stack< stdmessage > | _holdmsgqueu |
Definition at line 41 of file stdobject.h.
|
|
Reimplemented in stdui::stdwindow. Definition at line 46 of file stdobject.h. |
|
|
Reimplemented in stdui::stdwindow. Definition at line 45 of file stdobject.h. |
|
|
Reimplemented in stdui::stdwindow. Definition at line 44 of file stdobject.h. |
|
|
default empty contructor. Initialize sensible data to default values.
Definition at line 28 of file stdobject.cpp. References _flags, _name, _parent, and _thid. 00028 :sigc::trackable()
00029 {
00030 _flags = (stdflags)0;
00031 _name = "undef";
00032 _parent= (stdobject*)0;
00033 _thid = pthread_self();
00034 }
|
|
||||||||||||||||
|
common contructor that initialize the object with provided values.
Definition at line 41 of file stdobject.cpp. 00041 : 00042 sigc::trackable(), 00043 _parent(__parentobj), 00044 _name(nameid) 00045 { 00046 _flags = __flags; 00047 _thid = pthread_self(); 00048 }
|
|
|
Definition at line 51 of file stdobject.cpp. References destroy_, and destroy_children(). 00052 {
00053 // Informs all non-child object, which want to be notified about the destruction of this object.
00054 destroy_.emit(this); //this call returns when the last connected slot returns...
00055 destroy_children();
00056 }
|
Here is the call graph for this function:

|
|
|
|
|
Simply add ( or links ) a child opbject into the end of the children list.
Definition at line 67 of file stdobject.cpp. References _children. 00068 {
00069 _children.push_back(_obj);
00070 _obj->setparent(this);
00071 return _children.size();
00072 }
|
|
||||||||||
|
returns all children object of type T into a std::list given as the argument l
Definition at line 181 of file stdobject.h. References _tpl_it. 00182 {
00183 T* obj=0l;
00184 iterator temp_it = _tpl_it;
00185 if( !l.empty() ) l.clear();
00186 if( ! ( obj = firstchildof<T>() ) ){
00187 _tpl_it = temp_it;
00188 return 0;
00189 }
00190 do l.push_back(obj); while( ( obj = nextchildof<T>() ) != 0l);
00191 _tpl_it = temp_it;
00192 return l.size();
00193 }
|
|
|
return the classname.
Definition at line 85 of file stdobject.h. References _clsname. 00085 { return _clsname; }
|
|
|
Recusively destroy and delete the children objects.
Definition at line 83 of file stdobject.cpp. References _children. Referenced by ~stdobject(). 00084 {
00085 int i = _children.size();
00086 if(!i) return 0;
00087 for( iterator it = _children.begin(); it != _children.end(); it++) delete (*it);
00088 return i;
00089 }
|
|
|
Definition at line 98 of file stdobject.h. References destroy_. Referenced by main(). 00098 {
00099 return destroy_.connect(_slot);
00100 }
|
|
|
return ( expose ) the instance of the stdobject's destroy signal to be used for connecting a client slot.
Definition at line 79 of file stdobject.h. References destroy_. 00079 { return destroy_; }
|
|
|||||||||
|
Returns the first occurence of the object of type T into the object's children list.
Definition at line 202 of file stdobject.h. References _children, and _tpl_it. 00203 {
00204 T* pobj;
00205 if( _children.empty() ) return (T*)0l;
00206 _tpl_it = _children.begin();
00207 do{
00208 if( (pobj = dynamic_cast<T*>(_tpl_it)) != 0l ) return pobj;
00209 _tpl_it++;
00210 } while(_tpl_it != _children.end());
00211 return (T*)0l;
00212 }
|
|
|
Definition at line 137 of file stdobject.h. 00137 { return evt::reject; }
|
|
|||||||||
|
Returns the last occurence of the object of type T into the object children list.
Definition at line 241 of file stdobject.h. References _children, and _tpl_it. 00242 {
00243 T* pobj;
00244 iterator it = _children.end();
00245 it--;
00246 if(it == _children.end()) return (T*)0l;
00247 do{
00248 if( (pobj = dynamic_cast<T*>(*it)) ) return pobj;
00249 it--;
00250 }while(_tpl_it != _children.end());
00251 return it == _children.end() ? (T*)0l : *it;
00252 }
|
|
|
Definition at line 131 of file stdobject.cpp. 00132 {
00134 }
|
|
|
Definition at line 142 of file stdobject.h. 00142 { return evt::reject; }
|
|
|
return the object's name.
Definition at line 91 of file stdobject.h. References _name. 00091 { return _name; }
|
|
|||||||||
|
Returns the next occurence of the object of type T from the object's children list, since the last call of std::object::firstchildof().
Definition at line 222 of file stdobject.h. References _children, and _tpl_it. 00223 {
00224 T* pobj;
00225 if(_tpl_it == _children.end() ) if( !(pobj = firstchildof<T>())) return (T*)0l;
00226 _tpl_it++;
00227 do{
00228 if( (pobj = dynamic_cast<T*>(_tpl_it)) != 0l ) return pobj;
00229 _tpl_it++;
00230 } while(_tpl_it != _children.end());
00231 return (T*)0l;
00232 }
|
|
|
Returns the address of the immediate parent object as a stdobject class object.
Definition at line 70 of file stdobject.h. References _parent. Referenced by parentof(). 00070 { return _parent; }
|
|
||||||||||
|
returns all parent objects of type T into a std::list given as the argument l
Definition at line 146 of file stdobject.h. References parentof(). 00147 {
00148 T* pr = parentof<T>();
00149 while(pr){
00150 l.push_back(pr);
00151 pr = pr->parentof<T>();
00152 }
00153 return l.size();
00154 }
|
Here is the call graph for this function:

|
|||||||||
|
Returns the first occurence of this object's parent of type T from the object's parent chain.
Definition at line 162 of file stdobject.h. References parent(). Referenced by parent_chain(). 00163 {
00164 T* P=0l;
00165 stdobject* o = this;
00166 while(P == 0l){
00167 o = o->parent();
00168 if(!o) return 0l;
00169 if( ( P = dynamic_cast<T*>(o) ) != 0l) return P;
00170 }
00171 return (T*)0l;
00172 }
|
Here is the call graph for this function:

|
|
Definition at line 112 of file stdobject.cpp. References _holdmsgqueu. 00113 {
00114 _holdmsgqueu.push( msg );
00115 return _holdmsgqueu.size();
00116 }
|
|
|
Definition at line 122 of file stdobject.cpp. 00123 {
00125 }
|
|
|
Set this object's parent to _obj.
Definition at line 100 of file stdobject.cpp. References _parent. 00101 {
00102 _parent = _obj;
00103 return 0;
00104 }
|
|
|
just returns the thread id ....
Definition at line 106 of file stdobject.h. References _thid. 00106 { return _thid; }
|
|
|
std::list container for the immeditate children.
Definition at line 122 of file stdobject.h. Referenced by addchild(), destroy_children(), firstchildof(), lastchildof(), and nextchildof(). |
|
|
explicite class name of the object. ( avoiding using std::typeinfo for gcc which mangle the classnames...
Definition at line 126 of file stdobject.h. Referenced by classname(). |
|
|
Object's current states and flags.
Definition at line 110 of file stdobject.h. Referenced by stdobject(). |
|
|
Definition at line 114 of file stdobject.h. Referenced by postevent(). |
|
|
Object's name.
Definition at line 128 of file stdobject.h. Referenced by name(), and stdobject(). |
|
|
Pointer to the parent object.
Definition at line 118 of file stdobject.h. Referenced by parent(), setparent(), and stdobject(). |
|
|
parents list built upon the creation of this object. -- not yet used.
Definition at line 124 of file stdobject.h. |
|
|
Definition at line 113 of file stdobject.h. Referenced by stdobject(), and threadid(). |
|
|
Persistent children iterator used to save current position into the childrfen list.
Definition at line 112 of file stdobject.h. Referenced by childrenof(), firstchildof(), lastchildof(), and nextchildof(). |
|
|
sigc::signal object that holds slots to be iterated during deletion of this object.
Definition at line 120 of file stdobject.h. Referenced by destroy_delegate(), destroy_signal(), and ~stdobject(). |
1.4.0