Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JNullAccessibleOutput< T > Struct Template Reference

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::JSingleton< JNullOutput< T > > JLANG::JObjectOutput< T > JLANG::JAccessible JLANG::JThrow< JAccessible > JLANG::JThrow< JAccessible >

Public Types

typedef T data_type
 

Public Member Functions

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

Static Public Member Functions

static data_typegetInstance ()
 Get unique instance of template class.
 
static void Throw (const bool option)
 Enable/disable throw option.
 
static int Throw (const JException_t &error, const int value=-1)
 Throw exception or return error.
 

Static Protected Attributes

static bool do_throw
 throw option
 

Detailed Description

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

Implementation for null output with null access.

Definition at line 189 of file JObjectOutput.hh.

Member Typedef Documentation

◆ data_type

T JLANG::JSingleton< T >::data_type
inherited

Definition at line 20 of file JSingleton.hh.

Member Function Documentation

◆ put()

template<class T >
virtual bool JLANG::JNullOutput< T >::put ( const T & object)
inlineoverridevirtualinherited

Object output.

Parameters
objectobject
Returns
false

Implements JLANG::JObjectOutput< T >.

Definition at line 153 of file JObjectOutput.hh.

154 {
155 return false;
156 }

◆ getInstance()

static data_type & JLANG::JSingleton< T >::getInstance ( )
inlinestaticinherited

Get unique instance of template class.

Returns
object

Definition at line 27 of file JSingleton.hh.

28 {
29 static data_type value;
30
31 return value;
32 }

◆ is_open()

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 }

◆ open()

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 {}

◆ close()

virtual void JLANG::JNullAccess::close ( )
inlineoverridevirtualinherited

Close device.

Implements JLANG::JAccessible.

Definition at line 92 of file JAccessible.hh.

93 {}

◆ Throw() [1/2]

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 }

◆ Throw() [2/2]

static int JLANG::JThrow< JAccessible >::Throw ( const JException_t & error,
const int value = -1 )
inlinestaticinherited

Throw exception or return error.

Parameters
errorexception
valuereturn code
Returns
return code

Definition at line 51 of file JThrow.hh.

52 {
53 using namespace std;
54
55 if (do_throw) {
56 throw error;
57 }
58
59 cerr << error.what() << endl;
60
61 return value;
62 }

Member Data Documentation

◆ do_throw

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: