objectCM.h

00001 
00002 /* Copyright (c) 2007-2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef EQNET_OBJECTCM_H
00019 #define EQNET_OBJECTCM_H
00020 
00021 #include <eq/net/dispatcher.h>   // base class
00022 #include <eq/net/types.h>
00023 
00024 namespace eq
00025 {
00026 namespace net
00027 {
00028     class Node;
00029     class Object;
00030 
00039     class ObjectCM : public Dispatcher
00040     {
00041     public:
00043         ObjectCM() {}
00044         virtual ~ObjectCM() {}
00045 
00054         virtual void makeThreadSafe() = 0;
00055 
00066         virtual uint32_t commitNB() = 0;
00067         
00074         virtual uint32_t commitSync( const uint32_t commitID ) = 0;
00075 
00081         virtual void obsolete( const uint32_t version ) = 0;
00082 
00090         virtual void setAutoObsolete( const uint32_t count,
00091                                       const uint32_t flags ) = 0;
00092  
00094         virtual uint32_t getAutoObsoleteCount() const = 0;
00095 
00103         virtual uint32_t sync( const uint32_t version ) = 0;
00104 
00106         virtual uint32_t getHeadVersion() const = 0;
00107 
00109         virtual uint32_t getVersion() const = 0;
00110 
00112         virtual uint32_t getOldestVersion() const = 0;
00114 
00116         virtual bool isMaster() const = 0;
00117 
00119         virtual uint32_t getMasterInstanceID() const = 0;
00120 
00128         virtual void addSlave( NodePtr node, const uint32_t instanceID,
00129                                const uint32_t version ) = 0;
00130 
00136         virtual void removeSlave( NodePtr node ) = 0;
00137 
00139         virtual void applyMapData() = 0;
00140 
00142         virtual void addOldMaster( NodePtr node, const uint32_t instanceID ) =0;
00143 
00145         static ObjectCM* ZERO;
00146     };
00147 }
00148 }
00149 
00150 #endif // EQNET_OBJECTCM_H
Generated on Mon Aug 10 18:58:40 2009 for Equalizer 0.9 by  doxygen 1.5.8