Safir SDK Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Object.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Copyright Saab AB, 2005-2013 (http://safir.sourceforge.net)
4 *
5 * Created by: Lars Hagström / stlrha
6 *
7 *******************************************************************************
8 *
9 * This file is part of Safir SDK Core.
10 *
11 * Safir SDK Core is free software: you can redistribute it and/or modify
12 * it under the terms of version 3 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * Safir SDK Core is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Safir SDK Core. If not, see <http://www.gnu.org/licenses/>.
22 *
23 ******************************************************************************/
24 
25 #ifndef __DOTS_OBJECT_H__
26 #define __DOTS_OBJECT_H__
27 
28 #include <boost/shared_ptr.hpp>
33 
34 
35 namespace Safir
36 {
37 namespace Dob
38 {
39 namespace Typesystem
40 {
41  class Object; //forward declaration for typedef below
42 
44  typedef boost::shared_ptr<Object> ObjectPtr;
45 
47  typedef boost::shared_ptr<const Object> ObjectConstPtr;
48 
55  {
56  public:
60  Object() {}
61 
67  virtual ~Object() {}
68 
78  virtual Dob::Typesystem::ObjectPtr Clone() const;
79 
87  static Dob::Typesystem::ObjectPtr Create();
88 
89 
91  static const Dob::Typesystem::TypeId ClassTypeId = 5955188366590963785LL;
92 
103  virtual Dob::Typesystem::TypeId GetTypeId() const {return ClassTypeId;}
104 
114  virtual bool IsChanged();
115 
123  virtual void SetChanged(const bool changed);
124 
147  virtual ContainerBase & GetMember(const Dob::Typesystem::MemberIndex member,
148  const Dob::Typesystem::ArrayIndex index); //MUST BE OVERRIDDEN!
149 
164  virtual const ContainerBase & GetMember(const Dob::Typesystem::MemberIndex member,
165  const Dob::Typesystem::ArrayIndex index) const; //MUST BE OVERRIDDEN!
166 
181  explicit Object(char const * const blob);
182 
188  virtual Dob::Typesystem::Int32 CalculateBlobSize() const;
189 
198  virtual void WriteToBlob(char * blob, char * & beginningOfUnused) const;
199 
201  };
202 }
203 }
204 }
205 
206 #endif
207 
The base class for all DOB objects.
Definition: Object.h:54
Object()
Default constructor.
Definition: Object.h:60
boost::shared_ptr< const Object > ObjectConstPtr
A smart pointer to a const Object.
Definition: Object.h:47
DotsC_TypeId TypeId
A unique type identifier.
Definition: Defs.h:219
virtual Dob::Typesystem::TypeId GetTypeId() const
Get the type id of this object.
Definition: Object.h:103
boost::shared_ptr< Object > ObjectPtr
A smart pointer to an Object.
Definition: Object.h:41
DotsC_ArrayIndex ArrayIndex
Index into an array.
Definition: Defs.h:247
Base class for all Containers.
Definition: ContainerBase.h:41
virtual ~Object()
Virtual destructor.
Definition: Object.h:67
DotsC_Int32 Int32
32 bit integer type.
Definition: Defs.h:67
#define DOTS_CPP_API
Definition: Defs.h:33
DotsC_MemberIndex MemberIndex
The index of a member in an object.
Definition: Defs.h:238
static bool IsChanged(const ContainerBase &container)
Check if a container is changed.
Definition: ContainerBase.h:134