BALL  1.4.1
connectionObject.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 #ifndef BALL_VIEW_KERNEL_CONNECTIONOBJECT_H
00006 #define BALL_VIEW_KERNEL_CONNECTIONOBJECT_H
00007 
00008 #ifndef BALL_COMMON_MACROS_H
00009 # include <BALL/COMMON/macros.h>
00010 #endif
00011 
00012 namespace BALL
00013 {
00014   namespace VIEW
00015   {
00016     class Message;
00017   
00039     class BALL_VIEW_EXPORT ConnectionObject
00040     {
00041       public:
00042       
00046 
00050       ConnectionObject();
00051         
00053 
00056 
00061       virtual ~ConnectionObject();
00062 
00067       virtual void clear();
00068 
00073       virtual void destroy();
00074 
00076 
00079       
00087       void registerConnectionObject(ConnectionObject &object);
00088 
00097       void unregisterConnectionObject(ConnectionObject &object);
00098 
00105       bool isConnectionObjectRegistered(const ConnectionObject &object);
00106 
00111       ConnectionObject* getParent() const;
00112 
00116       ConnectionObject* getRoot();
00117 
00126       virtual void onNotify(Message *message);
00127 
00129 
00132 
00145       virtual bool isValid() const;
00146 
00153       virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
00154 
00156       
00160   
00161       protected:
00162       
00183       void notify_(Message *message);
00184 
00191       void notify_(Message &message);
00192 
00194 
00195       protected:
00196 
00197       void onNotify_(Message* message);
00198 
00199       private:
00200 
00201       void setParent_(ConnectionObject &object);
00202 
00203       void clearParent_();
00204 
00205   
00206       bool processing_message_queue_;
00207       std::list<Message *> message_queue_;
00208 
00209       ConnectionObject *parent_;
00210       std::list<ConnectionObject *> children_connection_objects_;
00211     };
00212 
00213 #   ifndef BALL_NO_INLINE_FUNCTIONS
00214 #     include <BALL/VIEW/KERNEL/connectionObject.iC>
00215 #   endif
00216       
00217 } } // namespace
00218 #endif // BALL_VIEW_KERNEL_CONNECTIONOBJECT_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines