Jpp
Public Member Functions | List of all members
JIO::JReader Class Referenceabstract

Interface for binary input. More...

#include <JSerialisable.hh>

Inheritance diagram for JIO::JReader:
JLANG::JBinaryInput JLANG::JAbstractObjectStatus JIO::JBufferedReader JIO::JByteArrayReader JIO::JFileReader JIO::JStreamReader JIO::JFileStreamReader JNET::JSocketInputChannel< JPrefix_t > JIO::JBinaryFileReader< JPhotonPath > JIO::JBinaryFileReader< T > JMARKOV::JPhotonPathReader JSUPPORT::JDAQFileReader< T, true >

Public Member Functions

virtual void clear ()
 Clear status of reader. More...
 
JReaderoperator>> (JSerialisable &object)
 Read serialisable data object. More...
 
JReaderoperator>> (bool &value)
 
JReaderoperator>> (char &value)
 
JReaderoperator>> (unsigned char &value)
 
JReaderoperator>> (short &value)
 
JReaderoperator>> (unsigned short &value)
 
JReaderoperator>> (int &value)
 
JReaderoperator>> (unsigned int &value)
 
JReaderoperator>> (long int &value)
 
JReaderoperator>> (long long int &value)
 
JReaderoperator>> (unsigned long long int &value)
 
JReaderoperator>> (float &value)
 
JReaderoperator>> (double &value)
 
JReaderoperator>> (long double &value)
 
JReaderload (JSerialisable &object)
 Read object. More...
 
template<class T >
JReaderload (T &object)
 Read object. More...
 
virtual int read (char *buffer, const int length)=0
 Read byte array. More...
 
virtual bool getStatus () const =0
 Get status of object. More...
 
 operator bool () const
 Type conversion operator. More...
 
bool operator! () const
 Negated status of this object. More...
 

Detailed Description

Interface for binary input.

Definition at line 62 of file JSerialisable.hh.

Member Function Documentation

◆ clear()

virtual void JIO::JReader::clear ( )
inlinevirtual

Clear status of reader.

Reimplemented in JIO::JBufferedReader, and JIO::JStreamReader.

Definition at line 70 of file JSerialisable.hh.

71  {}

◆ operator>>() [1/14]

JReader& JIO::JReader::operator>> ( JSerialisable object)
inline

Read serialisable data object.

Parameters
objectserialisable data object
Returns
JReader

Definition at line 80 of file JSerialisable.hh.

81  {
82  return object.read(*this);
83  }

◆ operator>>() [2/14]

JReader& JIO::JReader::operator>> ( bool &  value)
inline

Definition at line 86 of file JSerialisable.hh.

86 { read((char*) &value, sizeof(bool)); return *this; }

◆ operator>>() [3/14]

JReader& JIO::JReader::operator>> ( char &  value)
inline

Definition at line 87 of file JSerialisable.hh.

87 { read((char*) &value, sizeof(char)); return *this; }

◆ operator>>() [4/14]

JReader& JIO::JReader::operator>> ( unsigned char &  value)
inline

Definition at line 88 of file JSerialisable.hh.

88 { read((char*) &value, sizeof(unsigned char)); return *this; }

◆ operator>>() [5/14]

JReader& JIO::JReader::operator>> ( short &  value)
inline

Definition at line 89 of file JSerialisable.hh.

89 { read((char*) &value, sizeof(short)); return *this; }

◆ operator>>() [6/14]

JReader& JIO::JReader::operator>> ( unsigned short &  value)
inline

Definition at line 90 of file JSerialisable.hh.

90 { read((char*) &value, sizeof(unsigned short)); return *this; }

◆ operator>>() [7/14]

JReader& JIO::JReader::operator>> ( int &  value)
inline

Definition at line 91 of file JSerialisable.hh.

91 { read((char*) &value, sizeof(int)); return *this; }

◆ operator>>() [8/14]

JReader& JIO::JReader::operator>> ( unsigned int &  value)
inline

Definition at line 92 of file JSerialisable.hh.

92 { read((char*) &value, sizeof(unsigned int)); return *this; }

◆ operator>>() [9/14]

JReader& JIO::JReader::operator>> ( long int &  value)
inline

Definition at line 93 of file JSerialisable.hh.

93 { read((char*) &value, sizeof(long int)); return *this; }

◆ operator>>() [10/14]

JReader& JIO::JReader::operator>> ( long long int &  value)
inline

Definition at line 94 of file JSerialisable.hh.

94 { read((char*) &value, sizeof(long long int)); return *this; }

◆ operator>>() [11/14]

JReader& JIO::JReader::operator>> ( unsigned long long int &  value)
inline

Definition at line 95 of file JSerialisable.hh.

95 { read((char*) &value, sizeof(unsigned long long int)); return *this; }

◆ operator>>() [12/14]

JReader& JIO::JReader::operator>> ( float &  value)
inline

Definition at line 96 of file JSerialisable.hh.

96 { read((char*) &value, sizeof(float)); return *this; }

◆ operator>>() [13/14]

JReader& JIO::JReader::operator>> ( double &  value)
inline

Definition at line 97 of file JSerialisable.hh.

97 { read((char*) &value, sizeof(double)); return *this; }

◆ operator>>() [14/14]

JReader& JIO::JReader::operator>> ( long double &  value)
inline

Definition at line 98 of file JSerialisable.hh.

98 { read((char*) &value, sizeof(long double)); return *this; }

◆ load() [1/2]

JReader& JIO::JReader::load ( JSerialisable object)
inline

Read object.

Parameters
objectobject
Returns
this reader

Definition at line 107 of file JSerialisable.hh.

108  {
109  return object.read(*this);
110  }

◆ load() [2/2]

template<class T >
JReader& JIO::JReader::load ( T &  object)
inline

Read object.

Parameters
objectobject
Returns
this reader

Definition at line 120 of file JSerialisable.hh.

121  {
122  return *this >> object;
123  }

◆ read()

virtual int JLANG::JBinaryInput::read ( char *  buffer,
const int  length 
)
pure virtualinherited

Read byte array.

Parameters
bufferpointer to byte array
lengthnumber of bytes
Returns
number of bytes read

Implemented in JIO::JBufferedReader, JNET::JSocket, JIO::JByteArrayReader, JLANG::JFile, JIO::JStreamReader, JIO::JFileReader, and JNET::JSocketBlocking.

◆ getStatus()

virtual bool JLANG::JAbstractObjectStatus::getStatus ( ) const
pure virtualinherited

◆ operator bool()

JLANG::JAbstractObjectStatus::operator bool ( ) const
inlineinherited

Type conversion operator.

Returns
status of this object

Definition at line 33 of file JAbstractObjectStatus.hh.

34  {
35  return this->getStatus();
36  }

◆ operator!()

bool JLANG::JAbstractObjectStatus::operator! ( ) const
inlineinherited

Negated status of this object.

Returns
negated status of this object

Definition at line 44 of file JAbstractObjectStatus.hh.

45  {
46  return !(this->getStatus());
47  }

The documentation for this class was generated from the following file:
JLANG::JBinaryInput::read
virtual int read(char *buffer, const int length)=0
Read byte array.
JLANG::JAbstractObjectStatus::getStatus
virtual bool getStatus() const =0
Get status of object.