11#ifndef __interface_stream_h
12#define __interface_stream_h
18std::ostream& interface_insertion (std::ostream& ostr,
const T* e)
try
24 = const_cast<T*>(e)->get_interface();
26 ostr << interface->get_interface_name ();
28 if (interface->get_nvalue() == 0)
33 for (
unsigned i=0; i<interface->get_nvalue(); i++)
38 ostr << interface->get_name(i) <<
"=" << interface->get_value(i);
45 ostr.setstate (std::ios::failbit);
53 return interface_insertion (ostr, e.
get());
61std::istream& interface_extraction (std::istream& istr, T* &e)
try
66 e = T::factory (parse);
77 istr.setstate (std::ios::failbit);
85 interface_extraction (istr, ptr);
97 std::ostream& operator<< (std::ostream& ostr,
const To<T>& e)
99 return interface_insertion (ostr, e);
103 std::istream& operator >> (std::istream& istr,
To<T>& e)
105 return interface_extraction (istr, e);
A convenient exception handling class.
Definition Error.h:54
ErrorCode get_code() const
Get the error code.
Definition Error.h:92
Template class manages Reference::Able objects.
Definition ReferenceTo.h:25
Type * get() const
Return the pointer.
Definition ReferenceTo.h:251
Contains two basic classes that simplify dynamic memory management.
Definition HeapTracked.h:17