connectionObject.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: connectionObject.h,v 1.23 2005/12/23 17:02:14 amoll Exp $
00005 //
00006 
00007 #ifndef BALL_VIEW_KERNEL_CONNECTIONOBJECT_H
00008 #define BALL_VIEW_KERNEL_CONNECTIONOBJECT_H
00009 
00010 #ifndef BALL_DATATYPE_LIST_H
00011 # include <BALL/DATATYPE/list.h>
00012 #endif
00013 
00014 namespace BALL
00015 {
00016   namespace VIEW
00017   {
00018     class Message;
00019   
00041     class BALL_VIEW_EXPORT ConnectionObject
00042     {
00043       public:
00044       
00048 
00052       ConnectionObject();
00053         
00055 
00058 
00063       virtual ~ConnectionObject();
00064 
00069       virtual void clear();
00070 
00075       virtual void destroy();
00076 
00078 
00081       
00089       void registerConnectionObject(ConnectionObject &object);
00090 
00099       void unregisterConnectionObject(ConnectionObject &object);
00100 
00107       bool isConnectionObjectRegistered(const ConnectionObject &object);
00108 
00113       ConnectionObject* getParent() const;
00114 
00118       ConnectionObject* getRoot();
00119 
00128       virtual void onNotify(Message *message);
00129 
00131 
00134 
00147       virtual bool isValid() const;
00148 
00155       virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
00156 
00158       
00162   
00163       protected:
00164       
00185       void notify_(Message *message);
00186 
00193       void notify_(Message &message);
00194 
00196 
00197       protected:
00198 
00199       void onNotify_(Message* message);
00200 
00201       private:
00202 
00203       void setParent_(ConnectionObject &object);
00204 
00205       void clearParent_();
00206 
00207   
00208       bool processing_message_queue_;
00209       List<Message *> message_queue_;
00210 
00211       ConnectionObject *parent_;
00212       List<ConnectionObject *> children_connection_objects_;
00213     };
00214 
00215 #   ifndef BALL_NO_INLINE_FUNCTIONS
00216 #     include <BALL/VIEW/KERNEL/connectionObject.iC>
00217 #   endif
00218       
00219 } } // namespace
00220 #endif // BALL_VIEW_KERNEL_CONNECTIONOBJECT_H