Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
JIO::JFileReader Class Reference

Binary input based on a file descriptor. More...

#include <JFileIO.hh>

Inheritance diagram for JIO::JFileReader:
JIO::JReader JLANG::JBinaryInput JLANG::JAbstractObjectStatus

Public Member Functions

 JFileReader (const JFile &file)
 Constructor. More...
 
virtual bool getStatus () const override
 Status of reader. More...
 
virtual int read (char *buffer, const int length) override
 Read byte array. More...
 
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>> (unsigned long int &value)
 
JReaderoperator>> (long long int &value)
 
JReaderoperator>> (unsigned long long int &value)
 
JReaderoperator>> (float &value)
 
JReaderoperator>> (double &value)
 
JReaderoperator>> (long double &value)
 
JReaderoperator>> (JLANG::JObjectID &value)
 
JReaderload (JSerialisable &object)
 Read object. More...
 
template<class T >
JReaderload (T &object)
 Read object. More...
 
 operator bool () const
 Type conversion operator. More...
 
bool operator! () const
 Negated status of this object. More...
 

Protected Attributes

JFile in
 

Detailed Description

Binary input based on a file descriptor.

This class implements the JReader interface.

Definition at line 26 of file JFileIO.hh.

Constructor & Destructor Documentation

JIO::JFileReader::JFileReader ( const JFile file)
inline

Constructor.

Parameters
filefile

Definition at line 35 of file JFileIO.hh.

35  :
36  in(file)
37  {}
then usage $script[< detector identifier >< run range >]< QA/QCfile > nExample script to produce data quality plots nWhen a detector identifier and run range are data are downloaded from the database nand subsequently stored in the given QA QC file
Definition: JDataQuality.sh:19

Member Function Documentation

virtual bool JIO::JFileReader::getStatus ( ) const
inlineoverridevirtual

Status of reader.

Returns
status of this reader

Implements JLANG::JAbstractObjectStatus.

Definition at line 45 of file JFileIO.hh.

46  {
47  return in.good();
48  }
virtual bool good() const
Check status.
Definition: JFile.hh:130
virtual int JIO::JFileReader::read ( char *  buffer,
const int  length 
)
inlineoverridevirtual

Read byte array.

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

Implements JLANG::JBinaryInput.

Definition at line 58 of file JFileIO.hh.

59  {
60  return in.read(buffer, length);
61  }
virtual int read(char *buffer, const int length)
Read data from file.
Definition: JFile.hh:80
virtual void JIO::JReader::clear ( )
inlinevirtualinherited

Clear status of reader.

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

Definition at line 71 of file JSerialisable.hh.

72  {}
JReader& JIO::JReader::operator>> ( JSerialisable object)
inlineinherited

Read serialisable data object.

Parameters
objectserialisable data object
Returns
JReader

Definition at line 81 of file JSerialisable.hh.

82  {
83  return object.read(*this);
84  }
JReader& JIO::JReader::operator>> ( bool &  value)
inlineinherited

Definition at line 87 of file JSerialisable.hh.

87 { read((char*) &value, sizeof(bool)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( char &  value)
inlineinherited

Definition at line 88 of file JSerialisable.hh.

88 { read((char*) &value, sizeof(char)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( unsigned char &  value)
inlineinherited

Definition at line 89 of file JSerialisable.hh.

89 { read((char*) &value, sizeof(unsigned char)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( short &  value)
inlineinherited

Definition at line 90 of file JSerialisable.hh.

90 { read((char*) &value, sizeof(short)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( unsigned short &  value)
inlineinherited

Definition at line 91 of file JSerialisable.hh.

91 { read((char*) &value, sizeof(unsigned short)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( int &  value)
inlineinherited

Definition at line 92 of file JSerialisable.hh.

92 { read((char*) &value, sizeof(int)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( unsigned int &  value)
inlineinherited

Definition at line 93 of file JSerialisable.hh.

93 { read((char*) &value, sizeof(unsigned int)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( long int &  value)
inlineinherited

Definition at line 94 of file JSerialisable.hh.

94 { read((char*) &value, sizeof(long int)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( unsigned long int &  value)
inlineinherited

Definition at line 95 of file JSerialisable.hh.

95 { read((char*) &value, sizeof(unsigned long int)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( long long int &  value)
inlineinherited

Definition at line 96 of file JSerialisable.hh.

96 { read((char*) &value, sizeof(long long int)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( unsigned long long int &  value)
inlineinherited

Definition at line 97 of file JSerialisable.hh.

97 { read((char*) &value, sizeof(unsigned long long int)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( float &  value)
inlineinherited

Definition at line 98 of file JSerialisable.hh.

98 { read((char*) &value, sizeof(float)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( double &  value)
inlineinherited

Definition at line 99 of file JSerialisable.hh.

99 { read((char*) &value, sizeof(double)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( long double &  value)
inlineinherited

Definition at line 100 of file JSerialisable.hh.

100 { read((char*) &value, sizeof(long double)); return *this; }
virtual int read(char *buffer, const int length)=0
Read byte array.
JReader& JIO::JReader::operator>> ( JLANG::JObjectID value)
inlineinherited

Definition at line 101 of file JSerialisable.hh.

101 { return (*this) >> value.getID(); }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
JReader& JIO::JReader::load ( JSerialisable object)
inlineinherited

Read object.

Parameters
objectobject
Returns
this reader

Definition at line 110 of file JSerialisable.hh.

111  {
112  return object.read(*this);
113  }
template<class T >
JReader& JIO::JReader::load ( T object)
inlineinherited

Read object.

Parameters
objectobject
Returns
this reader

Definition at line 123 of file JSerialisable.hh.

124  {
125  return *this >> object;
126  }
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  }
virtual bool getStatus() const =0
Get status of object.
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  }
virtual bool getStatus() const =0
Get status of object.

Member Data Documentation

JFile JIO::JFileReader::in
protected

Definition at line 64 of file JFileIO.hh.


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