Object(s) writing to binary file.  
 More...
#include <JBinaryFileWriter.hh>
 | 
| static void  | Throw (const bool option) | 
|   | Enable/disable throw option.  More...
  | 
|   | 
| static int  | Throw (const JException &error, const int value=-1) | 
|   | Throw exception or return error.  More...
  | 
|   | 
template<class T>
class JIO::JBinaryFileWriter< T >
Object(s) writing to binary file. 
This class implements the JLANG::JAccessibleObjectOutput interface. 
Definition at line 32 of file JBinaryFileWriter.hh.
 
Default constructor. 
Definition at line 42 of file JBinaryFileWriter.hh.
Interface for binary output. 
 
JAccessibleBinaryOutputStream()
Default constructor. 
 
JStreamWriter(std::ostream &__out)
Constructor. 
 
Implementation of object output using JIO::JWriter for single data type. 
 
 
 
 
  
  
      
        
          | virtual void JLANG::JAccessibleBinaryOutputStream::open  | 
          ( | 
          const char *  | 
          file_name | ) | 
           | 
         
       
   | 
  
inlineoverridevirtualinherited   | 
  
 
 
  
  
      
        
          | virtual bool JLANG::JAccessibleOutputStream::is_open  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlinevirtualinherited   | 
  
 
 
  
  
      
        
          | virtual void JLANG::JAccessibleOutputStream::close  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinevirtualinherited   | 
  
 
 
Enable/disable throw option. 
- Parameters
 - 
  
    | option | true enable; false disable  | 
  
   
Definition at line 37 of file JThrow.hh.
static bool do_throw
throw option 
 
 
 
 
Throw exception or return error. 
- Parameters
 - 
  
    | error | exception  | 
    | value | return code  | 
  
   
- Returns
 - return code 
 
Definition at line 50 of file JThrow.hh.
   58       cerr << error.
what() << endl;
 
virtual const char * what() const override
Get error message. 
 
static bool do_throw
throw option 
 
 
 
 
  
  
      
        
          | virtual bool JIO::JStreamWriter::getStatus  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineoverridevirtualinherited   | 
  
 
 
  
  
      
        
          | virtual int JIO::JStreamWriter::write  | 
          ( | 
          const char *  | 
          buffer,  | 
         
        
           | 
           | 
          const int  | 
          length  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlineoverridevirtualinherited   | 
  
 
Write byte array. 
- Parameters
 - 
  
    | buffer | pointer to byte array  | 
    | length | number of bytes  | 
  
   
- Returns
 - number of bytes written 
 
Implements JLANG::JBinaryOutput.
Definition at line 113 of file JStreamIO.hh.
  115       out.write(buffer, length); 
 
 
 
 
Write serialisable data object. 
- Parameters
 - 
  
    | object | serialisable data object  | 
  
   
- Returns
 - JWriter 
 
Definition at line 144 of file JSerialisable.hh.
  146       return object.write(*
this); 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const bool  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 150 of file JSerialisable.hh.
  150 { 
write((
const char*) &value, 
sizeof(
bool));                   
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const char  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 151 of file JSerialisable.hh.
  151 { 
write((
const char*) &value, 
sizeof(
char));                   
return *
this; } 
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const unsigned char  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 152 of file JSerialisable.hh.
  152 { 
write((
const char*) &value, 
sizeof(
unsigned char));          
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const short  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 153 of file JSerialisable.hh.
  153 { 
write((
const char*) &value, 
sizeof(
short));                  
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const unsigned short  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 154 of file JSerialisable.hh.
  154 { 
write((
const char*) &value, 
sizeof(
unsigned short));         
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const int  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 155 of file JSerialisable.hh.
  155 { 
write((
const char*) &value, 
sizeof(
int));                    
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const unsigned int  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 156 of file JSerialisable.hh.
  156 { 
write((
const char*) &value, 
sizeof(
unsigned int));           
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const long int  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 157 of file JSerialisable.hh.
  157 { 
write((
const char*) &value, 
sizeof(
long int));               
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const unsigned long int  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 158 of file JSerialisable.hh.
  158 { 
write((
const char*) &value, 
sizeof(
unsigned long int));      
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const long long int  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 159 of file JSerialisable.hh.
  159 { 
write((
const char*) &value, 
sizeof(
long long int));          
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const unsigned long long int  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 160 of file JSerialisable.hh.
  160 { 
write((
const char*) &value, 
sizeof(
unsigned long long int)); 
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const float  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 161 of file JSerialisable.hh.
  161 { 
write((
const char*) &value, 
sizeof(
float));                  
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const double  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 162 of file JSerialisable.hh.
  162 { 
write((
const char*) &value, 
sizeof(
double));                 
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
  
  
      
        
          | JWriter& JIO::JWriter::operator<<  | 
          ( | 
          const long double  | 
          value | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Definition at line 163 of file JSerialisable.hh.
  163 { 
write((
const char*) &value, 
sizeof(
long double));            
return *
this; }
 
virtual int write(const char *buffer, const int length)=0
Write byte array. 
 
 
 
 
Definition at line 164 of file JSerialisable.hh.
  164 { 
return (*
this) << value.
getID(); }
 
int getID() const 
Get identifier. 
 
 
 
 
Write object. 
- Parameters
 - 
  
  
 
- Returns
 - this writer 
 
Definition at line 173 of file JSerialisable.hh.
  175       return object.write(*
this);
 
 
 
 
template<class T > 
  
  
      
        
          | JWriter& JIO::JWriter::store  | 
          ( | 
          const T &  | 
          object | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Write object. 
- Parameters
 - 
  
  
 
- Returns
 - this writer 
 
Definition at line 186 of file JSerialisable.hh.
  188       return *
this << object;
 
 
 
 
  
  
      
        
          | JLANG::JAbstractObjectStatus::operator bool  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Type conversion operator. 
- Returns
 - status of this object 
 
Definition at line 33 of file JAbstractObjectStatus.hh.
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.
virtual bool getStatus() const =0
Get status of object. 
 
 
 
 
template<class T> 
  
  | 
      
   | 
  
inlineoverridevirtualinherited   | 
  
 
 
throw option 
Set default throw option to true. 
Definition at line 28 of file JThrow.hh.
 
 
  
  
      
        
          | std::ostream& JIO::JStreamWriter::out | 
         
       
   | 
  
protectedinherited   | 
  
 
 
The documentation for this class was generated from the following file: