Skip to content
Snippets Groups Projects
Commit 5e9961b1 authored by Martin Nolte's avatar Martin Nolte
Browse files

make headercheck pass

parent cdbb5d0d
No related branches found
No related tags found
No related merge requests found
EXTRA_DIST = gitter_geo.cc gitter_impl.cc gitter_mgb.cc gitter_sti.cc mapp_cube_3d.cc\ EXTRA_DIST = gitter_geo.cc gitter_impl.cc gitter_mgb.cc gitter_sti.cc mapp_cube_3d.cc\
mapp_tetra_3d.cc myalloc.cc ghost_elements.cc ghost_info.cc \ mapp_tetra_3d.cc myalloc.cc ghost_elements.cc ghost_info.cc \
gitter_hexa_top.cc gitter_tetra_top.cc gitter_hexa_top.cc gitter_tetra_top.cc
include $(top_srcdir)/am/global-rules
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
#define SERIALIZE_H_INCLUDED #define SERIALIZE_H_INCLUDED
#include <cassert> #include <cassert>
#include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <string>
#include <utility>
class ObjectStream; class ObjectStream;
...@@ -199,10 +202,10 @@ public: ...@@ -199,10 +202,10 @@ public:
// make sure that char has size of 1, // make sure that char has size of 1,
// otherwise check doExchange in mpAccess_MPI.cc // otherwise check doExchange in mpAccess_MPI.cc
char * buffer = (char *) malloc (newSize * sizeof(char)) ; char * buffer = (char *) malloc (newSize * sizeof(char)) ;
if ( ! buffer ) if( !buffer )
{ {
perror ("**EXCEPTION in ObjectStream :: allocateBuffer(size_t) ") ; perror( "**EXCEPTION in ObjectStream::allocateBuffer( size_t ) " );
throw OutOfMemoryException () ; throw OutOfMemoryException();
} }
return buffer; return buffer;
} }
...@@ -309,7 +312,8 @@ protected: ...@@ -309,7 +312,8 @@ protected:
} ; } ;
// bufchunk 0.25 Megabyte // bufchunk 0.25 Megabyte
class ObjectStream : public ObjectStreamImpl class ObjectStream
: public ObjectStreamImpl
{ {
typedef ObjectStreamImpl BaseType; typedef ObjectStreamImpl BaseType;
...@@ -319,38 +323,36 @@ class ObjectStream : public ObjectStreamImpl ...@@ -319,38 +323,36 @@ class ObjectStream : public ObjectStreamImpl
// true if object stream was not set // true if object stream was not set
bool notReceived_ ; bool notReceived_ ;
public : public:
// ENDOFSTREAM should be in range of char, i.e. 0 to 256 // ENDOFSTREAM should be in range of char, i.e. 0 to 256
// and not conflict with refinement rules in gitter_sti.h // and not conflict with refinement rules in gitter_sti.h
static const char ENDOFSTREAM = 127; static const char ENDOFSTREAM = 127;
// create empty object stream // create empty object stream
inline ObjectStream () ObjectStream ()
: BaseType(BufChunk), : BaseType( BufChunk ),
notReceived_( true ) notReceived_( true )
{ {}
}
// create empty object stream with given chunk size // create empty object stream with given chunk size
explicit ObjectStream ( const size_t chunkSize ) explicit ObjectStream ( const std::size_t chunkSize )
: BaseType( chunkSize ), : BaseType( chunkSize ),
notReceived_( true ) notReceived_( true )
{ {}
}
// copy constructor // copy constructor
inline ObjectStream (const ObjectStream & os) ObjectStream ( const ObjectStream &os )
: BaseType(os), : BaseType( static_cast< const BaseType & >( os ) ),
notReceived_( true ) notReceived_( true )
{} {}
public: public:
// assigment of streams, owner ship of buffer is // assigment of streams, owner ship of buffer is
// passed from os to this stream to avoid copy of large memory areas // passed from os to this stream to avoid copy of large memory areas
inline ObjectStream & operator = (const ObjectStream & os) ObjectStream &operator= ( const ObjectStream &os )
{ {
BaseType::operator =(os); static_cast< BaseType & >( *this ) = static_cast< const BaseType & >( os );
notReceived_ = os.notReceived_ ; notReceived_ = os.notReceived_;
return *this; return *this;
} }
...@@ -368,10 +370,10 @@ protected: ...@@ -368,10 +370,10 @@ protected:
// assign pair of char buffer and size to this object stream // assign pair of char buffer and size to this object stream
// osvec will contain zeros after that assignment // osvec will contain zeros after that assignment
// used by mpAccess_MPI.cc // used by mpAccess_MPI.cc
ObjectStream &operator = ( std::pair< char *, int > &osvec ) ObjectStream &operator= ( std::pair< char *, int > &osvec )
{ {
BaseType :: removeObj(); BaseType::removeObj();
BaseType :: assign( osvec.first , osvec.second ); BaseType::assign( osvec.first, osvec.second );
// reset osvec // reset osvec
osvec.first = 0; osvec.first = 0;
osvec.second = 0; osvec.second = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment