17 virtual String serialize(
void)
const {
return ""; };
18 virtual void deserialize(String input) {};
20 virtual bool operator==(
const Serializable &other)
const 22 if (
typeid(*
this) !=
typeid(other))
26 return serialize() == other.serialize();
31 class FE_DL_EXPORT InfoSerializable :
public BaseType::Info
34 IWORD output(std::ostream &ostrm,
void *instance, t_serialMode mode)
override;
35 void input(std::istream &istrm,
void *instance, t_serialMode mode)
override;
36 String print(
void *instance)
override;
37 void construct(
void *instance)
override;
38 IWORD iosize(
void)
override;
42 class FE_DL_EXPORT InfoSp :
public BaseType::Info
45 IWORD output(std::ostream &ostrm,
void *instance, t_serialMode mode)
override 50 feX(
"Binary serialization not implemented.");
58 void input(std::istream &istrm,
void *instance, t_serialMode mode)
override 63 feX(
"Binary serialization not implemented.");
66 String print(
void *instance)
override {
return ""; };
67 void construct(
void *instance)
override {};
68 IWORD iosize(
void)
override {
return 0; };
72 class FE_DL_EXPORT InfoSerializableArray :
public BaseType::Info
75 IWORD output(std::ostream &ostrm,
void *instance, t_serialMode mode)
override;
76 void input(std::istream &istrm,
void *instance, t_serialMode mode)
override;
77 String print(
void *instance)
override;
78 void construct(
void *instance)
override;
79 IWORD iosize(
void)
override;
86 IWORD InfoSerializableArray<T>::output(std::ostream &ostrm,
void *instance, t_serialMode mode)
91 feX(
"Binary serialization not implemented.");
96 Array<T> *pArray = (Array<T> *)instance;
99 IWORD size = pArray->size();
100 helpIWORD.output(ostrm, &size, t_serialMode::e_ascii);
104 for (
unsigned int i = 0; i < size; i++)
107 String output = pArray->at(i).serialize();
110 ostrm <<
"\"" << output.c_str() <<
"\"";
118 void InfoSerializableArray<T>::input(std::istream &istrm,
void *instance, t_serialMode mode)
120 if (mode == e_binary)
123 feX(
"Binary serialization not implemented.");
128 Array<T> *pArray = (Array<T> *)instance;
133 helpIWORD.input(istrm, &size, t_serialMode::e_ascii);
138 for (
unsigned int i = 0; i < size; i++)
153 String input(str.c_str());
154 input = input.parse();
158 item.deserialize(input);
161 pArray->push_back(item);
167 String InfoSerializableArray<T>::print(
void *instance)
169 Array<T> *pArray = (Array<T> *)instance;
170 IWORD size = pArray->size();
174 for (
unsigned int i = 0; i < size; i++)
176 s.cat(
" <%s>", pArray->at(i).serialize().c_str());
182 IWORD InfoSerializableArray<T>::iosize(
void)
188 void InfoSerializableArray<T>::construct(
void *instance){};
191 IWORD InfoSerializable<T>::output(std::ostream &ostrm,
void *instance, t_serialMode mode)
193 if (mode == e_binary)
198 feX(
"Binary serialization not implemented.");
209 String output = ((T *)instance)->serialize();
212 ostrm <<
"\"" << output.c_str() <<
"\"";
219 void InfoSerializable<T>::input(std::istream &istrm,
void *instance, t_serialMode mode)
221 if (mode == e_binary)
226 feX(
"Binary serialization not implemented.");
250 String input(str.c_str());
251 input = input.parse();
254 ((T *)instance)->deserialize(input);
259 String InfoSerializable<T>::print(
void *instance)
262 s.cat(
" <%s>", ((T *)instance)->serialize().c_str());
267 IWORD InfoSerializable<T>::iosize(
void)
273 void InfoSerializable<T>::construct(
void *instance){};
kernel
Definition: namespace.dox:3
BWORD operator==(const DualString &s1, const DualString &s2)
Compare two DualString's.
Definition: DualString.h:208