Semantic Object File.
More...
#include <sof.h>
|
| | SOF (const std::string &p_name, const std::string &p_mode) |
| | Ctor from a name.
|
| |
|
| SOF (const SOF &p_other) |
| | Copy ctor.
|
| |
|
| ~SOF () override |
| | Dtor.
|
| |
|
| SOF (SOF &&)=delete |
| |
|
SOF & | operator= (const SOF &)=delete |
| |
|
SOF & | operator= (SOF &&)=delete |
| |
|
std::string | getFName () const |
| | Returns the file name.
|
| |
|
std::string | getFMode () const |
| | Returns the file mode.
|
| |
| SOF * | dup () const override |
| | Creates a new instance as copy following the red book definition.
|
| |
| std::string | opequalequal () const override |
| | String representation for operators '==' and 'pstack'.
|
| |
| OTCode | ot () const override |
| | Returns an OTCode.
|
| |
| std::string_view | type () const override |
| | Returns a type name.
|
| |
| bool | isOpen () const |
| | Checks if the file is open.
|
| |
| bool | readLeonLine (std::string &p_str) |
| | Our std::getline( istream, string ) version.
|
| |
| OpError | open () |
| | Opens the file.
|
| |
| OpError | flush () |
| | Flushes the file.
|
| |
| OpError | close (int(*p_fclose)(FILE *)=fclose) |
| | Closes the file.
|
| |
| OpError | readline (std::string &p_str, bool &p_eof) |
| | Reads a line of text from file.
|
| |
| OpError | readstring (std::string &p_str, bool &p_eof) |
| | Reads text from file.
|
| |
| OpError | writestring (const std::string &p_data) |
| | Writes to file.
|
| |
| OpError | writestring (std::string_view p_data) |
| | Writes to file.
|
| |
| OpError | writestring (const char *p_data) |
| | Writes to file.
|
| |
| std::string | opequal () const override |
| | String representation of object for operators '=', 'cvs' and 'stack'.
|
| |
| bool | equal (const SO *p_other) const override |
| | Checks if this SO is equal to another SO.
|
| |
|
| SO () |
| | Ctor.
|
| |
| | SO (bool p_exec) |
| | Ctor.
|
| |
|
| SO (const SO &p_other) |
| | Copy ctor.
|
| |
|
| SO (SO &&)=delete |
| |
|
| SO () |
| | Ctor.
|
| |
| | SO (bool p_exec) |
| | Ctor.
|
| |
|
| SO (const SO &p_other) |
| | Copy ctor.
|
| |
| virtual | ~SO ()=default |
| | Virtual dtor.
|
| |
|
| SO (SO &&)=delete |
| |
|
SO & | operator= (const SO &)=delete |
| |
|
SO & | operator= (SO &&)=delete |
| |
|
bool | getExec () const |
| | Getter for exec_.
|
| |
|
void | setExec (bool p_exec) |
| | Setter for exec_.
|
| |
| virtual size_t | getSize () const |
| | Returns the size of the SO.
|
| |
| virtual SO * | clone () const |
| | Creates a new instance as copy with deep cloning.
|
| |
| virtual bool | gt (OpError &p_ec, const SO *) const |
| | Greater than.
|
| |
| virtual bool | ge (OpError &p_ec, const SO *) const |
| | Greater or equal.
|
| |
|
| Counter (Counter< SO > &&)=delete |
| |
|
Counter< SO > & | operator= (const Counter< SO > &)=delete |
| |
|
Counter< SO > & | operator= (Counter< SO > &&)=delete |
| |
|
| void * | shptr () const override |
| | Pointer to the shared object.
|
| |
| bool | invariant () const noexcept override |
| | Checks class invariants.
|
| |
|
| Counter () |
| | Ctor.
|
| |
|
| Counter (const Counter< SO > &) |
| | Copy ctor.
|
| |
|
| ~Counter () |
| | Dtor.
|
| |
|
| ~DbC ()=default |
| | Protected dtor.
|
| |
|
|
std::shared_ptr< SOFData > | f_ |
| | The data.
|
| |
|
|
static size_t | getTotalCounter () |
| | Static getter for totaly created objects.
|
| |
|
static size_t | getAliveCounter () |
| | Static getter for objects alive.
|
| |
|
static size_t | getWatermarkCounter () |
| | Static getter for the object counter watermark.
|
| |
Semantic Object File.
- Invariant
- inherited from SOcomposite
◆ SOF()
| SOF::SOF |
( |
const std::string & |
p_name, |
|
|
const std::string & |
p_mode |
|
) |
| |
|
inlineexplicit |
Ctor from a name.
- Parameters
-
| [in] | p_name | The file name. |
| [in] | p_mode | The file open mode. |
◆ close()
| OpError SOF::close |
( |
int(*)(FILE *) |
p_fclose = fclose | ) |
|
Closes the file.
Can be called for already closed files.
- Parameters
-
| [in] | p_fclose | Can be set to a fclose() function for mocking in unit tests. |
- Returns
- OpError ... The error code or success.
◆ dup()
Creates a new instance as copy following the red book definition.
- Returns
- SO * ... A copy.
Implements SO.
◆ flush()
Flushes the file.
- Precondition
- f_->file_ == nullptr
- Returns
- OpError ... The error code or success.
◆ isOpen()
| bool SOF::isOpen |
( |
| ) |
const |
|
inline |
Checks if the file is open.
- Precondition
- f_->file_ != nullptr
- Returns
- bool ... true, if the file is open.
◆ open()
Opens the file.
- Precondition
- f_->file_ == nullptr
- Returns
- OpError ... The error code or success.
◆ opequalequal()
| std::string SOF::opequalequal |
( |
| ) |
const |
|
inlineoverridevirtual |
String representation for operators '==' and 'pstack'.
This function attempts to produce a result that resembles the red book syntax
for creating the object.
- Returns
- std::string ... The representation.
Reimplemented from SO.
◆ ot()
Returns an OTCode.
A "manual" implementation of polymorphism, where C++-polymorphisms fail
- Returns
- OTCode ... The OTCode of the instance.
Implements SO.
◆ readLeonLine()
| bool SOF::readLeonLine |
( |
std::string & |
p_str | ) |
|
Our std::getline( istream, string ) version.
- Precondition
- f_->file_ != nullptr
- Parameters
-
| [out] | p_str | Will be cleared and filled. |
- Returns
- bool ... Success or not.
◆ readline()
| OpError SOF::readline |
( |
std::string & |
p_str, |
|
|
bool & |
p_eof |
|
) |
| |
Reads a line of text from file.
- Precondition
- p_str size <= max_int
- Parameters
-
| [in,out] | p_str | Buffer to write the text to. Limited by its size. |
| [out] | p_eof | EOF status of file after the operation. |
- Returns
- OpError ... The error code or success.
◆ readstring()
| OpError SOF::readstring |
( |
std::string & |
p_str, |
|
|
bool & |
p_eof |
|
) |
| |
Reads text from file.
- Precondition
- p_str ist not empty
- Parameters
-
| [in,out] | p_str | Buffer to write the text to. Limited by its size. |
| [out] | p_eof | EOF status of file after the operation. |
- Returns
- OpError ... The error code or success.
◆ shptr()
| void * SOF::shptr |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
Pointer to the shared object.
- Returns
- void * ... The naked pointer.
Implements SOshptr.
◆ type()
| std::string_view SOF::type |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns a type name.
- Returns
- std::string_view ... The type name of the instance.
Implements SO.
◆ writestring() [1/3]
| OpError SOF::writestring |
( |
const char * |
p_data | ) |
|
Writes to file.
- Precondition
- p_data != nullptr
- Parameters
-
- Returns
- OpError ... The error code or success.
◆ writestring() [2/3]
| OpError SOF::writestring |
( |
const std::string & |
p_data | ) |
|
Writes to file.
- Parameters
-
- Returns
- OpError ... The error code or success.
◆ writestring() [3/3]
| OpError SOF::writestring |
( |
std::string_view |
p_data | ) |
|
Writes to file.
- Parameters
-
- Returns
- OpError ... The error code or success.
The documentation for this class was generated from the following files: