Code Search for Developers
 
 
  

ship_serializable_if.h from GreenSocs at Krugle


Show ship_serializable_if.h syntax highlighted

#ifndef __ship_serializable_if_h__
#define __ship_serializable_if_h__

#include "ship_datatypes.h"

namespace tlm {

//---------------------------------------------------------------------------
/**
 * This is an abstract class from which objects must inherit to be 
 * SHIP-transferrable.
 */
//---------------------------------------------------------------------------
class ship_serializable_if
{
public:
  
   /// Create a byte vector that represents the information content of this SHIP object.
   /**
    * This method has to be implemented by any SHIP object.
    * It should convert the information carried by this SHIP object
    * into a serial byte vector representation.
    * The deserialize method should be able to reconstruct a SHIP object
    * which has the same information content than this SHIP object 
    * from this byte vector.
    *
    * @return the number of bytes allocated in the byte vector.
    * @param data is a GSDataType into which the serial byte stream is to be copied.
    */
   virtual const gs_uint32 serialize(GSDataType &data) =0;

   /// Restore the information content of a SHIP content from a serial data stream.
   /**
    * This method has to be implemented by any SHIP object.
    * Its purpose is to read a serial data stream which was 
    * generated by the serialize method, and to copy the information content
    * of this data stream into the corresponding data fields
    * of this SHIP object.
    * 
    * @param data is a GSDataType that carries a serialized SHIP object. 
    * @return the number of bytes deserialized from the serial data stream.
    */
   virtual const gs_uint32 deserialize(GSDataType &data) =0;

   /// This method returns the number of bytes that would be allocated in a byte vector if the serialize method now would be invoked.
   /**
    * @return The number of bytes the serialize method would allocate if it would be invoked now.
    */
   virtual const gs_uint32 getSerialLength() =0;

  virtual ~ship_serializable_if() {}
     
};

} // namespace tlm

#endif




See more files for this project here

GreenSocs

To develop SystemC infrustructure, basic IP, patches and add on library code for eventual standerdization.\r\nThe GreenSocs project is made up of a number of contributions (sub projects). Please visit www.greensocs.com for more information.

Project homepage: http://sourceforge.net/projects/greensocs
Programming language(s): C,C++,Java,Perl,XML
License: other

  ship_datatypes.h
  ship_masterport.h
  ship_serializable_if.h
  ship_slaveport.h