VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
boolSetting.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: boolSetting.h,v $ $Revision: 1.6 $ $State: Exp $
7 *******************************************************************************/
8 
9 // \file boolSetting.h
10 // \brief Generic boolean object for use with DtSettingsManager
11 // This is a general purpose boolean object which is instantiated by
12 // DtSettingsManager::addIndependentBool.
13 
14 #ifndef boolSetting_H_
15 #define boolSetting_H_
16 
19 
20 #include <boost/serialization/nvp.hpp>
21 #include <boost/serialization/base_object.hpp>
22 #include <boost/serialization/export.hpp>
23 
24 #include <boost/archive/xml_iarchive.hpp>
25 #include <boost/archive/xml_oarchive.hpp>
26 #include <boost/archive/text_iarchive.hpp>
27 #include <boost/archive/text_oarchive.hpp>
28 
31 {
32 public:
33  // Default constructor, required for deserialization
34  DtBoolSetting();
35 
36  // Constructor
37  DtBoolSetting(std::string name, bool value);
38 
39  // Copy constructor
40  DtBoolSetting(const DtBoolSetting& orig);
41 
42  // Equality operator
43  virtual bool operator==(const DtSettingsObject & other) const;
44 
45  // Inequality operator
46  virtual bool operator!=(const DtSettingsObject & other) const;
47 
48  // Used by DtSettingsManager::setSetting when it needs to update an
49  // existing DtSettingsObject.
50  virtual bool setFrom(const DtSettingsObject* other);
51 
52  // Clone operator, returns a new settings which is a copy of this one.
53  virtual DtSettingsObject* clone() const;
54 
55  // The boolean value
57  bool value() const;
58  void setValue(bool value);
60 
61 private:
62  // Serialization support
63  friend class boost::serialization::access;
64  template<class Archive>
65  void serialize(Archive & ar, const unsigned int version)
66  {
67  // Serialize the base class
68  ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(DtSettingsObject);
69  // Serialize the members
70  ar & BOOST_SERIALIZATION_NVP(myValue);
71  }
72 
73 protected:
74  bool myValue;
75 };
76 
77 
78 #endif
virtual bool operator!=(const DtSettingsObject &orig) const
Definition: boolSetting.h:30
virtual bool setFrom(const DtSettingsObject *other)
Definition: settingsObject.h:27
bool myValue
Definition: boolSetting.h:74
void serialize(Archive &ar, const unsigned int version)
Definition: boolSetting.h:65
virtual DtSettingsObject * clone() const =0
virtual bool operator==(const DtSettingsObject &orig) const
#define DT_DLL_makSettingsManager
Definition: makSettingsManagerDefines.h:24

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)