Jpp  17.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
JLANG::JNullAccessibleOutput< T > Struct Template Referenceabstract

Implementation for null output with null access. More...

#include <JObjectOutput.hh>

Inheritance diagram for JLANG::JNullAccessibleOutput< T >:
JLANG::JAccessibleObjectOutput< T > JLANG::JNullOutput< T > JLANG::JNullAccess JLANG::JObjectOutput< T > JLANG::JAccessible JLANG::JObjectOutput< T > JLANG::JAccessible JLANG::JThrow< JAccessible > JLANG::JThrow< JAccessible >

Public Member Functions

virtual bool put (const T &object)=0
 Object output. More...
 
virtual bool is_open () const =0
 Check is device is open. More...
 
virtual void open (const char *file_name)=0
 Open device. More...
 
virtual void close ()=0
 Close device. More...
 
virtual bool put (const T &object)
 Object output. More...
 
virtual bool is_open () const override
 Check is device is open. More...
 
virtual void open (const char *file_name) override
 Open device. More...
 
virtual void close () override
 Close device. More...
 

Static Public Member Functions

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...
 

Static Protected Attributes

static bool do_throw
 throw option More...
 

Detailed Description

template<class T>
struct JLANG::JNullAccessibleOutput< T >

Implementation for null output with null access.

Definition at line 186 of file JObjectOutput.hh.

Member Function Documentation

template<class T>
virtual bool JLANG::JObjectOutput< T >::put ( const T object)
pure virtualinherited
virtual bool JLANG::JAccessible::is_open ( ) const
pure virtualinherited
virtual void JLANG::JAccessible::open ( const char *  file_name)
pure virtualinherited
virtual void JLANG::JAccessible::close ( )
pure virtualinherited
static void JLANG::JThrow< JAccessible >::Throw ( const bool  option)
inlinestaticinherited

Enable/disable throw option.

Parameters
optiontrue enable; false disable

Definition at line 37 of file JThrow.hh.

38  {
39  do_throw = option;
40  }
static bool do_throw
throw option
Definition: JThrow.hh:28
static int JLANG::JThrow< JAccessible >::Throw ( const JException error,
const int  value = -1 
)
inlinestaticinherited

Throw exception or return error.

Parameters
errorexception
valuereturn code
Returns
return code

Definition at line 50 of file JThrow.hh.

51  {
52  using namespace std;
53 
54  if (do_throw) {
55  throw error;
56  }
57 
58  cerr << error.what() << endl;
59 
60  return value;
61  }
virtual const char * what() const override
Get error message.
Definition: JException.hh:48
static bool do_throw
throw option
Definition: JThrow.hh:28
template<class T>
virtual bool JLANG::JNullOutput< T >::put ( const T object)
inlinevirtualinherited

Object output.

Parameters
objectobject
Returns
false

Implements JLANG::JObjectOutput< T >.

Definition at line 151 of file JObjectOutput.hh.

152  {
153  return false;
154  }
virtual bool JLANG::JNullAccess::is_open ( ) const
inlineoverridevirtualinherited

Check is device is open.

Returns
true

Implements JLANG::JAccessible.

Definition at line 74 of file JAccessible.hh.

75  {
76  return true;
77  }
virtual void JLANG::JNullAccess::open ( const char *  file_name)
inlineoverridevirtualinherited

Open device.

Parameters
file_namefile name

Implements JLANG::JAccessible.

Definition at line 85 of file JAccessible.hh.

86  {}
virtual void JLANG::JNullAccess::close ( )
inlineoverridevirtualinherited

Close device.

Implements JLANG::JAccessible.

Definition at line 92 of file JAccessible.hh.

93  {}

Member Data Documentation

bool JLANG::JThrow< JAccessible >::do_throw
staticprotectedinherited

throw option

Set default throw option to true.

Definition at line 28 of file JThrow.hh.


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