Updated the tests to conform the new Boost-like API
This commit is contained in:
parent
dc58ab7739
commit
0e56778327
5 changed files with 119 additions and 36 deletions
43
eo/test/mpi/t-mpi-common.h
Normal file
43
eo/test/mpi/t-mpi-common.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# ifndef __T_MPI_COMMON_H__
|
||||
# define __T_MPI_COMMON_H__
|
||||
|
||||
#include <serial/eoSerial.h>
|
||||
|
||||
template< class T >
|
||||
struct SerializableBase : public eoserial::Persistent
|
||||
{
|
||||
public:
|
||||
|
||||
operator T&()
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
|
||||
SerializableBase() : _value()
|
||||
{
|
||||
// empty
|
||||
}
|
||||
|
||||
SerializableBase( T base ) : _value( base )
|
||||
{
|
||||
// empty
|
||||
}
|
||||
|
||||
void unpack( const eoserial::Object* obj )
|
||||
{
|
||||
eoserial::unpack( *obj, "value", _value );
|
||||
}
|
||||
|
||||
eoserial::Object* pack(void) const
|
||||
{
|
||||
eoserial::Object* obj = new eoserial::Object;
|
||||
obj->add("value", eoserial::make( _value ) );
|
||||
return obj;
|
||||
}
|
||||
|
||||
private:
|
||||
T _value;
|
||||
};
|
||||
|
||||
|
||||
# endif // __T_MPI_COMMON_H__
|
||||
Loading…
Add table
Add a link
Reference in a new issue