Safir SDK Core
Loading...
Searching...
No Matches
Object.h
Go to the documentation of this file.
1/******************************************************************************
2*
3* Copyright Saab AB, 2005-2013 (http://safirsdkcore.com)
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 <memory>
33
34
35namespace Safir
36{
37namespace Dob
38{
39namespace Typesystem
40{
41 class Object; //forward declaration for typedef below
42
44 typedef std::shared_ptr<Object> ObjectPtr;
45
47 typedef std::shared_ptr<const Object> ObjectConstPtr;
48
55 {
56 public:
60 Object() {}
61
67 virtual ~Object() {}
68
79
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
148 const Dob::Typesystem::ArrayIndex index); //MUST BE OVERRIDDEN!
149
165 const Dob::Typesystem::ArrayIndex index) const; //MUST BE OVERRIDDEN!
166
182
188 virtual void WriteToBlob(Safir::Dob::Typesystem::Int64 handle) const;
189
191 };
192}
193}
194}
195
196#endif
197
This namespace contains all the functionality and definitions of the SAFIR SDK.
Definition Backdoor.h:31
std::shared_ptr< const Object > ObjectConstPtr
A smart pointer to a const Object.
Definition Object.h:47
DotsC_Int64 Int64
64 bit integer type.
Definition Defs.h:69
std::shared_ptr< Object > ObjectPtr
A smart pointer to an Object.
Definition Object.h:44
DotsC_ArrayIndex ArrayIndex
Index into an array.
Definition Defs.h:246
DotsC_TypeId TypeId
A unique type identifier.
Definition Defs.h:218
DotsC_MemberIndex MemberIndex
The index of a member in an object.
Definition Defs.h:237
Base class for all Containers.
Definition ContainerBase.h:44
The base class for all DOB objects.
Definition Object.h:55
virtual Dob::Typesystem::ObjectPtr Clone() const
Create a copy of the object.
virtual ContainerBase & GetMember(const Dob::Typesystem::MemberIndex member, const Dob::Typesystem::ArrayIndex index)
Get a reference to a member container from an object.
virtual Dob::Typesystem::TypeId GetTypeId() const
Get the type id of this object.
Definition Object.h:103
virtual const ContainerBase & GetMember(const Dob::Typesystem::MemberIndex member, const Dob::Typesystem::ArrayIndex index) const
Get a const reference to a member container from an object.
Object(Safir::Dob::Typesystem::Int64 handle)
Create an Object from a blob.
virtual bool IsChanged()
Check if any member of this object is changed.
virtual ~Object()
Virtual destructor.
Definition Object.h:67
virtual void WriteToBlob(Safir::Dob::Typesystem::Int64 handle) const
Write the object to a blob.
static Dob::Typesystem::ObjectPtr Create()
Creates a new Object.
virtual void SetChanged(const bool changed)
Recursively set change flags in all members of this object.
Object()
Default constructor.
Definition Object.h:60
#define DOTS_CPP_API
Definition Defs.h:33