Scopira  20080306
scopira::tool::iobjflow_i Class Referenceabstract

#include <flow.h>

Inheritance diagram for scopira::tool::iobjflow_i:
scopira::tool::itflow_i scopira::tool::iflow_i scopira::tool::flow_i scopira::tool::object scopira::tool::polyiflow scopira::tool::propiflow scopira::tool::isoiflow scopira::tool::archiveiflow

Public Member Functions

virtual bool read_object (object *&out)=0
 
template<class TT >
bool read_object_type (TT *&out)
 
template<class TT >
bool read_object_type (count_ptr< TT > &out)
 
- Public Member Functions inherited from scopira::tool::itflow_i
virtual bool read_bool (bool &)=0
 
virtual bool read_char (char &)=0
 
virtual bool read_short (short &)=0
 
virtual bool read_int (int &)=0
 
virtual bool read_size_t (size_t &)=0
 
virtual bool read_int64_t (int64_t &)=0
 
virtual bool read_long (long &)=0
 
virtual bool read_float (float &)=0
 
virtual bool read_double (double &)=0
 
virtual bool read_string (std::string &)=0
 
template<class TT >
bool read_generic (TT &v)
 
- Public Member Functions inherited from scopira::tool::iflow_i
virtual size_t read (byte_t *_buf, size_t _maxsize)=0
 
virtual size_t read_byte (byte_t &out)
 
template<class TT >
size_t read_array (TT *_buf, size_t _numelem)
 
size_t read_void (void *_buf, size_t _maxsize)
 
- Public Member Functions inherited from scopira::tool::flow_i
virtual bool failed (void) const =0
 
- Public Member Functions inherited from scopira::tool::object
virtual ~object ()
 
int add_ref (void) const
 
bool sub_ref (void) const
 
void auto_ref (void) const
 
int current_ref (void) const
 
virtual scopira::tool::oflow_iprint (scopira::tool::oflow_i &o) const
 
virtual bool load (scopira::tool::iobjflow_i &in)
 
virtual void save (scopira::tool::oobjflow_i &out) const
 
bool is_alive_object (void) const
 
bool is_dead_object (void) const
 

Additional Inherited Members

- Public Types inherited from scopira::tool::flow_i
enum  { input_c = 1, output_c = 2 }
 
typedef scopira::tool::byte_t byte_t
 
typedef int mode_t
 
- Protected Member Functions inherited from scopira::tool::object
 object (void)
 
 object (bool neverusecounter)
 

Detailed Description

Input object serialization. This interface adds a virtual-object read method to itflow_t. In total - via inheritance - this interface may read objects, primitive types (including streams) and raw bytes.

Author
Aleksander Demko

Member Function Documentation

◆ read_object()

virtual bool scopira::tool::iobjflow_i::read_object ( object *&  out)
pure virtual

Reads a virtual object from the flow.

The method may succeed (by returning true) and still set out to be null. This is normal, and just means that a null pointer was stored in the stream.

Always pass a real object*. Do not attempt to pass (via a cast) yourobject* to this method. You will be bitten by subtlies in the way C++ moves pointers around on multiple or virtual inheritance heiarchies.

Parameters
outthis will be set to the read object
Returns
true on success, false on failure.
Author
Aleksander Demko

Implemented in scopira::tool::isoiflow, scopira::tool::propiflow, and scopira::tool::polyiflow.

◆ read_object_type() [1/2]

template<class TT >
bool scopira::tool::iobjflow_i::read_object_type ( TT *&  out)

This is a type safe helper around read_object. It will do read_object on its own temporary object* and verify (via assert) that it can be cast to your type TT.

Parameters
outthe output pointer to set, may be null on success
Returns
true on success
Author
Aleksander Demko

◆ read_object_type() [2/2]

template<class TT >
bool scopira::tool::iobjflow_i::read_object_type ( count_ptr< TT > &  out)

Similar to read_object_type, but reads into an auto pointer directly.

Author
Aleksander Demko

The documentation for this class was generated from the following file: