ROOT output file.
More...
#include <JRootFile.hh>
|
static void | Throw (const bool option) |
| Enable/disable throw option. More...
|
|
static int | Throw (const JException_t &error, const int value=-1) |
| Throw exception or return error. More...
|
|
static void | release (JClass_t *p) |
| Release memory. More...
|
|
ROOT output file.
This class implements the methods open() and close() of the JLANG::JAccessible interface.
Definition at line 196 of file JRootFile.hh.
◆ pointer_type
template<class JClass_t , template< class > class JMemory_t = JNew>
◆ memory_type
template<class JClass_t , template< class > class JMemory_t = JNew>
◆ JRootOutputFile() [1/2]
JROOT::JRootOutputFile::JRootOutputFile |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 203 of file JRootFile.hh.
JRootFile()
Default constructor.
◆ JRootOutputFile() [2/2]
JROOT::JRootOutputFile::JRootOutputFile |
( |
const char * |
file_name | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 213 of file JRootFile.hh.
void do_open(const char *file_name)
Open file.
◆ ~JRootOutputFile()
JROOT::JRootOutputFile::~JRootOutputFile |
( |
| ) |
|
|
inline |
Destructor.
The destructor writes and closes the file if it is still open.
Definition at line 225 of file JRootFile.hh.
void do_close()
Close file.
◆ open()
virtual void JROOT::JRootOutputFile::open |
( |
const char * |
file_name | ) |
|
|
inlineoverridevirtual |
◆ close()
virtual void JROOT::JRootOutputFile::close |
( |
| ) |
|
|
inlineoverridevirtual |
◆ do_open()
void JROOT::JRootOutputFile::do_open |
( |
const char * |
file_name | ) |
|
|
inlineprivate |
Open file.
The file is not opened when a file exists with the given name.
- Parameters
-
Definition at line 260 of file JRootFile.hh.
262 set(TFile::Open(file_name,
"CREATE"));
#define MAKE_EXCEPTION(JException_t, A)
Make exception.
virtual void set(JClass_t *p) override
Set pointer.
static void Throw(const bool option)
Enable/disable throw option.
virtual bool is_open() const override
Check is file is open.
◆ do_close()
void JROOT::JRootOutputFile::do_close |
( |
| ) |
|
|
inlineprivate |
Close file.
This method calls the TFile::Write method before closing the file.
Definition at line 274 of file JRootFile.hh.
virtual void reset() override
Reset pointer.
TFile * getFile() const
Get file.
◆ getFile()
TFile* JROOT::JRootFile::getFile |
( |
| ) |
const |
|
inlineinherited |
Get file.
- Returns
- pointer to file
Definition at line 66 of file JRootFile.hh.
virtual JClass_t * get() const override
Get pointer.
◆ is_open()
virtual bool JROOT::JRootFile::is_open |
( |
| ) |
const |
|
inlineoverridevirtualinherited |
◆ Throw() [1/2]
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() [2/2]
Throw exception or return error.
- Parameters
-
error | exception |
value | return code |
- Returns
- return code
Definition at line 51 of file JThrow.hh.
59 cerr << error.what() << endl;
◆ reset() [1/5]
template<class JClass_t , template< class > class JMemory_t = JNew>
|
inlineoverridevirtualinherited |
Reset pointer.
The allocated memory is released.
Reimplemented from JLANG::JPointer< JClass_t >.
Reimplemented in JLANG::JSharedPointer< JClass_t, JMemory_t >, JLANG::JSharedPointer< JObjectIterator< T > >, JLANG::JSharedPointer< const TFormula >, JLANG::JSharedPointer< JFIT::JMEstimator >, JLANG::JSharedPointer< JAbstractAutoPointer< JBase_t > >, JLANG::JSharedPointer< JTRIGGER::JDAQHitSelector >, JLANG::JSharedPointer< match_type >, JLANG::JSharedPointer< JLOGGER::JLogger >, JLANG::JSharedPointer< JParserElementInterface >, JLANG::JSharedPointer< JAccessibleObjectIterator< T > >, JLANG::JSharedPointer< JExceptionHandler >, JLANG::JSharedPointer< JTRIGGER::JMatch >, JLANG::JSharedPointer< JBase_t >, JLANG::JSharedPointer< JObjectOutput< T > >, JLANG::JSharedPointer< JPropertiesElementInterface >, JLANG::JSharedPointer< JRewindableObjectIterator< T > >, JLANG::JSharedPointer< JAccessibleObjectOutput< T > >, JLANG::JSharedPointer< JNET::JControlHost >, JLANG::JSharedPointer< JTOOLS::JMultiMapTransformer >, and JLANG::JSharedPointer< JRadiation >.
Definition at line 42 of file JStorage.hh.
bool is_valid() const
Check validity of pointer.
virtual void reset() override
Reset pointer.
void release()
Release memory.
◆ reset() [2/5]
template<class JClass_t , template< class > class JMemory_t = JNew>
|
inlineoverridevirtualinherited |
Reset pointer.
Reimplemented from JLANG::JPointer< JClass_t >.
Reimplemented in JLANG::JSharedPointer< JObjectIterator< T > >, JLANG::JSharedPointer< const TFormula >, JLANG::JSharedPointer< JFIT::JMEstimator >, JLANG::JSharedPointer< JAbstractAutoPointer< JBase_t > >, JLANG::JSharedPointer< JTRIGGER::JDAQHitSelector >, JLANG::JSharedPointer< match_type >, JLANG::JSharedPointer< JLOGGER::JLogger >, JLANG::JSharedPointer< JParserElementInterface >, JLANG::JSharedPointer< JAccessibleObjectIterator< T > >, JLANG::JSharedPointer< JExceptionHandler >, JLANG::JSharedPointer< JTRIGGER::JMatch >, JLANG::JSharedPointer< JBase_t >, JLANG::JSharedPointer< JObjectOutput< T > >, JLANG::JSharedPointer< JPropertiesElementInterface >, JLANG::JSharedPointer< JRewindableObjectIterator< T > >, JLANG::JSharedPointer< JAccessibleObjectOutput< T > >, JLANG::JSharedPointer< JNET::JControlHost >, JLANG::JSharedPointer< JTOOLS::JMultiMapTransformer >, and JLANG::JSharedPointer< JRadiation >.
Definition at line 84 of file JPointer.hh.
JClass_t * __p
pointer to object
◆ reset() [3/5]
template<class JClass_t , template< class > class JMemory_t = JNew>
template<class T >
Reset pointer.
- Parameters
-
Definition at line 108 of file JPointer.hh.
110 this->
reset(pointer.get());
◆ reset() [4/5]
template<class JClass_t >
template<class T >
◆ reset() [5/5]
template<class JClass_t >
Reset pointer.
- Parameters
-
Definition at line 94 of file JAbstractPointer.hh.
96 if (this->
get() != p) {
virtual void set(JClass_t *p)=0
Set pointer.
virtual void reset()=0
Reset pointer.
virtual JClass_t * get() const =0
Get pointer.
◆ recreate()
template<class JClass_t , template< class > class JMemory_t = JNew>
Recreate object in memory.
A new object is created if no memory is allocated yet, else the previously created object is maintained.
Definition at line 57 of file JStorage.hh.
60 this->
set(memory_type::create());
◆ create() [1/2]
template<class JClass_t , template< class > class JMemory_t = JNew>
Create object in memory.
The memory allocated by a previously created object will be released.
Definition at line 69 of file JStorage.hh.
71 this->
reset(memory_type::create());
◆ create() [2/2]
template<class JClass_t , template< class > class JMemory_t = JNew>
void JLANG::JStorage< JClass_t, JMemory_t >::create |
( |
const unsigned int |
size | ) |
|
|
inlineinherited |
Create array of objects in memory.
The memory allocated by previously created objects will be released.
- Parameters
-
Definition at line 81 of file JStorage.hh.
83 this->
reset(memory_type::create(size));
◆ release() [1/2]
template<class JClass_t , template< class > class JMemory_t = JNew>
Release memory.
Definition at line 91 of file JStorage.hh.
93 memory_type::release(this->
get());
◆ release() [2/2]
template<class JClass_t >
static void JLANG::JNew< JClass_t >::release |
( |
JClass_t * |
p | ) |
|
|
inlinestaticinherited |
Release memory.
- Parameters
-
Definition at line 41 of file JMemory.hh.
◆ get()
template<class JClass_t >
|
inlineoverridevirtualinherited |
◆ set() [1/2]
template<class JClass_t >
|
inlineoverridevirtualinherited |
◆ set() [2/2]
template<class JClass_t >
template<class T >
Set pointer.
- Parameters
-
Definition at line 96 of file JPointer.hh.
◆ getReference() [1/2]
template<class JClass_t >
Get rereference to internal pointer.
- Returns
- reference to internal pointer
Definition at line 119 of file JPointer.hh.
◆ getReference() [2/2]
template<class JClass_t >
Get rereference to internal pointer.
- Returns
- reference to internal pointer
Definition at line 130 of file JPointer.hh.
◆ equals()
template<class JClass_t >
Equals.
The equality is evaluated by comparison of the internal pointers.
- Parameters
-
- Returns
- true if equals; else false
Definition at line 50 of file JAbstractPointer.hh.
52 return this->
get() ==
object.get();
◆ is_valid()
template<class JClass_t >
Check validity of pointer.
- Returns
- true if pointer not null; else false
Definition at line 83 of file JAbstractPointer.hh.
85 return this->
get() != NULL;
◆ operator->()
template<class JClass_t >
Smart pointer operator.
- Returns
- pointer to object
Definition at line 112 of file JAbstractPointer.hh.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for null pointer operation.
◆ operator JClass_t *()
template<class JClass_t >
◆ do_throw
throw option
Set default throw option to true
.
Definition at line 28 of file JThrow.hh.
◆ __p
template<class JClass_t >
The documentation for this class was generated from the following file: