Collage  1.7.0
High-performance C++ library for developing object-oriented distributed applications.
objectHandler.h
1 
2 /* Copyright (c) 2012-2016, 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, NodePtr master) = 0;
66 
68  virtual bool mapObjectSync(const uint32_t requestID) = 0;
69 
71  virtual void unmapObject(Object* object) = 0;
72 
74  CO_API void releaseObject(Object* object);
75 
96  virtual f_bool_t syncObject(
97  Object* object, const uint128_t& id, NodePtr master,
98  const uint32_t instanceID = CO_INSTANCE_ALL) = 0;
99 
100 protected:
104  virtual ~ObjectHandler() {}
105 };
106 }
107 #endif // CO_OBJECTHANDLER_H
virtual ~ObjectHandler()
Destroy this object handler.
Defines export visibility macros for library Collage.
A distributed object.
Definition: object.h:47
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.
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 f_bool_t syncObject(Object *object, const uint128_t &id, NodePtr master, const uint32_t instanceID=CO_INSTANCE_ALL)=0
Synchronize the local object with a remote object.
virtual uint32_t mapObjectNB(Object *object, const uint128_t &id, const uint128_t &version, NodePtr master)=0
Start mapping a distributed object.
lunchbox::RefPtr< Node > NodePtr
A reference pointer for Node pointers.
Definition: types.h:85