VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
settingsObject.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: settingsObject.h,v $ $Revision: 1.4 $ $State: Exp $
7 *******************************************************************************/
8 
9 // \file settingsObject.h
10 // \brief Base class for all settings objects used by DtSettings.
11 
12 #ifndef settingsObject_H_
13 #define settingsObject_H_
14 
15 // std includes
16 #include <string>
17 
18 // Boost includes
19 #include <boost/serialization/nvp.hpp>
20 #include <boost/archive/xml_iarchive.hpp>
21 #include <boost/archive/xml_oarchive.hpp>
22 
25 
28 {
29 public:
30  // Default constructor, required for deserialization
32 
33  // Constructor
34  DtSettingsObject(std::string name);
35 
36  // Copy constructor
38 
39  // Assignment operator
40  virtual void operator=(const DtSettingsObject& orig);
41 
42  // Equality operator
43  virtual bool operator==(const DtSettingsObject & orig) const;
44 
45  // Inequality operator
46  virtual bool operator!=(const DtSettingsObject& orig) const;
47 
48  // Clone operator, returns a new settings which is a copy of this one.
49  virtual DtSettingsObject* clone() const = 0;
50 
51  // Accessor for the setting name
52  virtual std::string name() const;
53 
54  // Reset this object based on another, used by DtSettingsManager::setSetting
55  virtual bool setFrom(const DtSettingsObject* other);
56 
57 private:
58  friend class boost::serialization::access;
59  // Serialization support. Derived classes must call
60  // BOOST_SERIALIZATION_BASE_OBJECT_NVP(DtSettingsObject) in their
61  // implementation of serialize.
62  template<class Archive>
63  void serialize(Archive & ar, const unsigned int version)
64  {
65  ar & BOOST_SERIALIZATION_NVP(myName);
66  }
67 
68 protected:
69  std::string myName;
70 };
71 
72 // Setup this class as abstract in boost
73 BOOST_SERIALIZATION_ASSUME_ABSTRACT(DtSettingsObject)
74 
75 #endif

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)