VR-Forces 4.0.4 Class Documentation
include/makArchives/DtSchema.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2008 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 /******************************************************************************
00006 ** $RCSfile: DtSchema.h,v $ $Revision: 1.10 $ $State: Exp $
00007 ******************************************************************************/
00008 
00011 
00012 #pragma once
00013 
00014 #include <makArchives/makArchives.h>
00015 #include <makArchives/DtSchemaEntry.h>
00016 
00017 namespace makArchives
00018 {
00022    class DT_DLL_MAKARCHIVES DtSchema
00023    {
00024    public:
00025       typedef std::vector<DtSchemaEntry> SchemaEntries;
00026 
00028       DtSchema();
00029       
00031       DtSchema(const std::string& name);
00032 
00034       DtSchema(const DtSchema& copy);
00035 
00037       ~DtSchema();
00038 
00040       DtSchema& operator=(const DtSchema& copy);
00041 
00043       const std::string& name() const
00044       {
00045          return myName;
00046       }
00047 
00049       void setName(const std::string& n)
00050       {
00051          myName = n;
00052       }
00053 
00055       virtual void addSchemaEntry(const DtSchemaEntry& entry);
00056 
00059       virtual bool removeSchemaEntry(const std::string name);
00060 
00062       const SchemaEntries& schemaEntries() const
00063       {
00064          return mySchemaEntries;
00065       }
00066 
00068       void clear()
00069       {
00070          mySchemaEntries.clear();
00071       }
00072 
00074       void setSchemaEntries(const SchemaEntries& e)
00075       {
00076          mySchemaEntries = e;
00077       }
00078 
00081       DtSchemaEntry* findSchemaEntry(const std::string name);
00082       const DtSchemaEntry* findSchemaEntry(const std::string name) const;
00083 
00087       virtual void merge(const DtSchema& rhs);
00088 
00090       virtual bool renameSchemaEntry(const std::string& oldName, const std::string& newName);
00091 
00092    protected:
00093 
00094       friend class boost::serialization::access;
00095 
00099 
00100       template <typename Archive>
00101       void serialize(Archive& ar,unsigned int version)
00102       {
00103          ar & BOOST_SERIALIZATION_NVP(myName);
00104 
00105          if (version < 2)
00106          {
00107             int myType;
00108             ar & BOOST_SERIALIZATION_NVP(myType);
00109          }
00110 
00111          ar & BOOST_SERIALIZATION_NVP(mySchemaEntries);
00112       }
00113 
00115       static bool findSchemaEntryFunction(const DtSchemaEntry& parameter, const std::string& name);
00116 
00117    protected:
00118       std::string       myName;
00119       SchemaEntries   mySchemaEntries;
00120    };
00121 };
00122 
00123 BOOST_CLASS_VERSION(makArchives::DtSchema,2)

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)