From: <sv...@ww...> - 2004-06-13 08:20:17
|
Author: mkrose Date: 2004-06-13 01:20:09 -0700 (Sun, 13 Jun 2004) New Revision: 1031 Modified: trunk/CSP/SimData/Include/SimData/Ref.h trunk/CSP/SimData/Include/SimData/Singleton.h trunk/CSP/SimData/Include/SimData/TaggedRecord.h trunk/CSP/SimData/Source/DataManager.cpp Log: TaggedRecord.h copyright notice; Singleton NonCopyable and const accessor; Ref already NonCopyable; DataManager cleanup bug. Modified: trunk/CSP/SimData/Include/SimData/Ref.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Ref.h 2004-06-13 03:11:52 UTC (rev 1030) +++ trunk/CSP/SimData/Include/SimData/Ref.h 2004-06-13 08:20:09 UTC (rev 1031) @@ -90,11 +90,6 @@ } inline unsigned _count() const { return __count; } mutable unsigned __count; - - // Referenced objects should never be copied; always allocate them on the - // heap and use Ref<> smart-pointers to refer to them. - Referenced const & operator=(Referenced const &); - Referenced(Referenced const &); }; Modified: trunk/CSP/SimData/Include/SimData/Singleton.h =================================================================== --- trunk/CSP/SimData/Include/SimData/Singleton.h 2004-06-13 03:11:52 UTC (rev 1030) +++ trunk/CSP/SimData/Include/SimData/Singleton.h 2004-06-13 08:20:09 UTC (rev 1031) @@ -29,13 +29,16 @@ #define __SIMDATA_SINGLETON_H__ #include <SimData/Namespace.h> +#include <SimData/Properties.h> NAMESPACE_SIMDATA /** Creates a single, static instance of the templated class. + * TODO could stand lots of improvement (delete priority, thread + * safety, etc). */ template <class C> -class Singleton { +class Singleton: public NonCopyable { public: /** Get the one instance of the template class. */ @@ -43,7 +46,10 @@ static C __instance; return __instance; } -private: + static C const & getConstInstance() { + return getInstance(); + } +protected: Singleton() {} ~Singleton() {} }; Modified: trunk/CSP/SimData/Include/SimData/TaggedRecord.h =================================================================== --- trunk/CSP/SimData/Include/SimData/TaggedRecord.h 2004-06-13 03:11:52 UTC (rev 1030) +++ trunk/CSP/SimData/Include/SimData/TaggedRecord.h 2004-06-13 08:20:09 UTC (rev 1031) @@ -1,6 +1,33 @@ -#ifndef __SIMDATA_TRF_H__ -#define __SIMDATA_TRF_H__ +/* SimData: Data Infrastructure for Simulations + * Copyright (C) 2004 Mark Rose <mk...@us...> + * + * This file is part of SimData. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * @file TaggedRecord.h + * @brief Base classes for tagged records. + */ + + +#ifndef __SIMDATA_TAGGED_RECORD_H__ +#define __SIMDATA_TAGGED_RECORD_H__ + #include <string> #include <stack> #include <vector> @@ -12,6 +39,7 @@ #include <SimData/Archive.h> #include <SimData/Namespace.h> + NAMESPACE_SIMDATA // use our own, platform-neutral int64 representation @@ -328,5 +356,5 @@ NAMESPACE_SIMDATA_END -#endif // __SIMDATA_TRF_H__ +#endif // __SIMDATA_TAGGED_RECORD_H__ Modified: trunk/CSP/SimData/Source/DataManager.cpp =================================================================== --- trunk/CSP/SimData/Source/DataManager.cpp 2004-06-13 03:11:52 UTC (rev 1030) +++ trunk/CSP/SimData/Source/DataManager.cpp 2004-06-13 08:20:09 UTC (rev 1031) @@ -45,6 +45,7 @@ *i = 0; } } + _archives.clear(); } void DataManager::addArchive(DataArchive *d) { |