VR-Forces 4.0.4 Class Documentation
include/makSettingsManager/settingsObject.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2008 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: settingsObject.h,v $ $Revision: 1.4 $ $State: Exp $
00007 *******************************************************************************/
00008 
00009 // \file settingsObject.h
00010 // \brief Base class for all settings objects used by DtSettings.
00011 
00012 #ifndef settingsObject_H_
00013 #define settingsObject_H_
00014 
00015 // std includes
00016 #include <string>
00017 
00018 // Boost includes
00019 #include <boost/serialization/nvp.hpp>
00020 #include <boost/archive/xml_iarchive.hpp>
00021 #include <boost/archive/xml_oarchive.hpp>
00022 
00025 
00026 #include "makSettingsManager/makSettingsManagerDefines.h"
00027 class DT_DLL_makSettingsManager DtSettingsObject
00028 {
00029 public:
00030    // Default constructor, required for deserialization   
00031    DtSettingsObject();
00032    
00033    // Constructor
00034    DtSettingsObject(std::string name);
00035    
00036    // Copy constructor
00037    DtSettingsObject(const DtSettingsObject& orig);
00038    
00039    // Assignment operator
00040    virtual void operator=(const DtSettingsObject& orig);
00041 
00042    // Equality operator
00043    virtual bool operator==(const DtSettingsObject & orig) const;
00044 
00045    // Inequality operator
00046    virtual bool operator!=(const DtSettingsObject& orig) const;
00047 
00048    // Clone operator, returns a new settings which is a copy of this one.
00049    virtual DtSettingsObject* clone() const = 0;
00050    
00051    // Accessor for the setting name
00052    virtual std::string name() const;
00053 
00054    // Reset this object based on another, used by DtSettingsManager::setSetting
00055    virtual bool setFrom(const DtSettingsObject* other);
00056 
00057 private:
00058    friend class boost::serialization::access;
00059    // Serialization support. Derived classes must call 
00060    // BOOST_SERIALIZATION_BASE_OBJECT_NVP(DtSettingsObject) in their
00061    // implementation of serialize.
00062    template<class Archive>
00063    void serialize(Archive & ar, const unsigned int version)
00064    {
00065       ar & BOOST_SERIALIZATION_NVP(myName);
00066    }
00067    
00068 protected:
00069    std::string myName;
00070 };
00071 
00072 // Setup this class as abstract in boost
00073 BOOST_SERIALIZATION_ASSUME_ABSTRACT(DtSettingsObject)
00074 
00075 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)