Safir SDK Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ContainerBase.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Copyright Saab AB, 2006-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_CONTAINER_BASE_H__
26 #define __DOTS_CONTAINER_BASE_H__
27 
28 namespace Safir
29 {
30 namespace Dob
31 {
32 namespace Typesystem
33 {
42  {
43  public:
50 
56  virtual ~ContainerBase() {}
57 
63  virtual bool IsNull() const = 0;
64 
68  virtual void SetNull() = 0;
69 
78  virtual bool IsChanged() const {return m_bIsChanged;}
79 
94  virtual void SetChanged(const bool changed) {m_bIsChanged = changed;}
95 
104  virtual void Copy(const ContainerBase & that) = 0;
105  protected:
106  friend class BlobOperations;
107  //BlobOperations is allowed to access the m_bIsChanged field directly
108 
118  {m_bIsChanged = other.m_bIsChanged; return *this;}
119 
124  };
125 
134  static inline bool IsChanged(const ContainerBase & container) {return container.IsChanged();}
135 
136 }
137 }
138 }
139 #endif
140 
virtual bool IsChanged() const
Is the change flag set on the container? The change flag gets updated every time the contained value ...
Definition: ContainerBase.h:78
Operations on blobs.
Definition: BlobOperations.h:53
virtual void Copy(const ContainerBase &that)=0
Virtual assignment.
ContainerBase & operator=(const ContainerBase &other)
Copy assignment operator.
Definition: ContainerBase.h:117
virtual ~ContainerBase()
Virtual destructor.
Definition: ContainerBase.h:56
virtual void SetChanged(const bool changed)
Set the containers change flag.
Definition: ContainerBase.h:94
virtual bool IsNull() const =0
Is the container set to null?
Base class for all Containers.
Definition: ContainerBase.h:41
virtual void SetNull()=0
Set the container to null.
bool m_bIsChanged
The variable containing the change flag.
Definition: ContainerBase.h:123
ContainerBase()
Default Constructor.
Definition: ContainerBase.h:49
static bool IsChanged(const ContainerBase &container)
Check if a container is changed.
Definition: ContainerBase.h:134