Collage  1.3.0
High-performance C++ library for developing object-oriented distributed applications.
objectHandler.h
1 
2 /* Copyright (c) 2012-2014, Stefan Eilemann <eile@eyescale.ch>
3  *
4  * This file is part of Collage <https://github.com/Eyescale/Collage>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 2.1 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef CO_OBJECTHANDLER_H
21 #define CO_OBJECTHANDLER_H
22 
23 #include <co/api.h>
24 #include <co/types.h>
25 
26 namespace co
27 {
30 {
31 public:
44  virtual bool registerObject( Object* object ) = 0;
45 
52  virtual void deregisterObject( Object* object ) = 0;
53 
64  virtual uint32_t mapObjectNB( Object* object, const uint128_t& id,
65  const uint128_t& version,
66  NodePtr master ) = 0;
67 
69  virtual bool mapObjectSync( const uint32_t requestID ) = 0;
70 
72  virtual void unmapObject( Object* object ) = 0;
73 
75  CO_API void releaseObject( Object* object );
76 
97  virtual f_bool_t syncObject( Object* object, NodePtr master,
98  const uint128_t& id,
99  const uint32_t instanceID=CO_INSTANCE_ALL) = 0;
100 protected:
103 
105  virtual ~ObjectHandler() {}
106 };
107 }
108 #endif // CO_OBJECTHANDLER_H
virtual ~ObjectHandler()
Destroy this object handler.
Defines export visibility macros for library Collage.
A distributed object.
Definition: object.h:45
virtual f_bool_t syncObject(Object *object, NodePtr master, const uint128_t &id, const uint32_t instanceID=CO_INSTANCE_ALL)=0
Synchronize the local object with a remote object.
CO_API void releaseObject(Object *object)
Convenience method to deregister or unmap an object.
virtual bool registerObject(Object *object)=0
Register a distributed object.
virtual void deregisterObject(Object *object)=0
Deregister a distributed object.
ObjectHandler()
Construct a new object handler.
virtual bool mapObjectSync(const uint32_t requestID)=0
Finalize the mapping of a distributed object.
lunchbox::RefPtr< Node > NodePtr
A reference pointer for Node pointers.
Definition: types.h:87
Object-oriented network library.
Definition: barrier.h:27
Interface for entities which map and register objects.
Definition: objectHandler.h:29
virtual void unmapObject(Object *object)=0
Unmap a mapped object.
virtual uint32_t mapObjectNB(Object *object, const uint128_t &id, const uint128_t &version, NodePtr master)=0
Start mapping a distributed object.