Collage  1.0.1
Object-Oriented C++ Network Library
objectHandler.h
1 
2 /* Copyright (c) 2012-2013, 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 UUID& 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 
77  protected:
80 
82  virtual ~ObjectHandler() {}
83  };
84 }
85 #endif // CO_OBJECTHANDLER_H
Interface for entities which map and register objects.
Definition: objectHandler.h:29
virtual ~ObjectHandler()
Destroy this object handler.
Definition: objectHandler.h:82
virtual void unmapObject(Object *object)=0
Unmap a mapped object.
virtual bool registerObject(Object *object)=0
Register a distributed object.
lunchbox::RefPtr< Node > NodePtr
A reference pointer for Node pointers.
Definition: types.h:80
virtual uint32_t mapObjectNB(Object *object, const UUID &id, const uint128_t &version, NodePtr master)=0
Start mapping a distributed object.
virtual bool mapObjectSync(const uint32_t requestID)=0
Finalize the mapping of a distributed object.
A distributed object.
Definition: object.h:45
ObjectHandler()
Construct a new object handler.
Definition: objectHandler.h:79
virtual void deregisterObject(Object *object)=0
Deregister a distributed object.
CO_API void releaseObject(Object *object)
Convenience method to deregister or unmap an object.