blob: 3a3b3204672b0cb8a55f51c4141b8fc34a4ec729 [file] [log] [blame]
Emeric Vigier2f625822012-08-06 11:09:52 -04001#ifndef TESTSUBOBJECT_H
2#define TESTSUBOBJECT_H
3
4// Copyright (C) 2002-2003 Chad C. Yates cyates@uidaho.edu
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 2 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19//
20// As a special exception to the GNU General Public License, permission is
21// granted for additional uses of the text contained in its release
22// of Common C++.
23//
24// The exception is that, if you link the Common C++ library with other
25// files to produce an executable, this does not by itself cause the
26// resulting executable to be covered by the GNU General Public License.
27// Your use of that executable is in no way restricted on account of
28// linking the Common C++ library code into it.
29//
30// This exception does not however invalidate any other reasons why
31// the executable file might be covered by the GNU General Public License.
32//
33// This exception applies only to the code released under the
34// name Common C++. If you copy code from other releases into a copy of
35// Common C++, as the General Public License permits, the exception does
36// not apply to the code that you add in this way. To avoid misleading
37// anyone as to the status of such modified files, you must delete
38// this exception notice from them.
39//
40// If you write modifications of your own for Common C++, it is your choice
41// whether to permit this exception to apply to your modifications.
42// If you do not wish that, delete this exception notice.
43
44#include <cc++/persist.h>
45#include <iterator>
46
47using namespace ost;
48using std::cout;
49using std::endl;
50using std::string;
51
52// an object used for embedding into TestObject to test object graph persistence
53class TestSub : public BaseObject
54{
55 DECLARE_PERSISTENCE(TestSub)
56
57public:
58 int32 iInteger;
59 std::string strString;
60 std::string strString2;
61 std::vector<double> numbers;
62
63 TestSub();
64 TestSub(const TestSub &ob);
65 ~TestSub() {};
66 bool operator==(const TestSub &ob) const;
67 bool operator!=(const TestSub &ob) const {return !(*this == ob); };
68
69 void print(const std::string& name) const;
70
71 virtual bool write(Engine& archive) const;
72 virtual bool read(Engine& archive);
73};
74
75#endif