1 #include "tao/Storable_Base.h"
2 #include "tao/Storable_Factory.h"
4 #include "tao/orbconf.h"
5 #include /**/ "tao/Version.h"
6 #include /**/ "tao/Versioned_Namespace.h"
8 #include "ace/SString.h"
10 class Savable_Exception
14 /// A simple class to use for testing whose contents
15 /// are to be persisted. It has attributes for each basic
16 /// type that can be saved.
17 /// There are two attributes for each type so that
18 /// one process can write one attribute of the same
19 /// type while another process reads another attribute
24 Savable (TAO::Storable_Factory
& storable_factory
);
28 void string_set (int index
, const ACE_CString
&s
);
29 const ACE_CString
& string_get (int index
);
31 void int_set (int index
, int i
);
32 int int_get (int index
);
34 void unsigned_int_set (int index
, unsigned int ui
);
35 unsigned int unsigned_int_get (int index
);
37 void bytes_set (int index
, int size
, char * bytes
);
38 int bytes_get (int index
, char * bytes
);
40 bool is_loaded_from_stream ();
43 TAO::Storable_Factory
& storable_factory_
;
44 bool loaded_from_stream_
;
46 void read (TAO::Storable_Base
& stream
);
47 void write (TAO::Storable_Base
& stream
);
49 ACE_CString string_
[2];
53 static const int bytes_size_max
;
57 friend class Savable_File_Guard
;