Semantic Object String.
More...
#include <sos.h>
|
|
| SOS (const std::string &p_str) |
| | Ctor.
|
| |
|
std::string | getString () const |
| | Getter for the string value.
|
| |
| void | setch (size_t p_index, int p_char) |
| | Sets a single character within the string.
|
| |
| SOS * | dup () const override |
| | Creates a new instance as copy following the red book definition.
|
| |
| SOS * | clone () const override |
| | Creates a new instance as copy with deep cloning.
|
| |
| std::string | opequal () const override |
| | For operators '=', 'cvs' and 'stack'.
|
| |
| std::string | opequalequal () const override |
| | For operators '==' and 'pstack'.
|
| |
| OTCode | ot () const override |
| | Returns an OTCode.
|
| |
| std::string | type () const override |
| | Returns a type name.
|
| |
| bool | equal (const SO *p_other) const override |
| | Equality.
|
| |
| bool | gt (const SO *p_other) const override |
| | Greater than.
|
| |
| bool | ge (const SO *p_other) const override |
| | Greater or equal.
|
| |
| size_t | getSize () const override |
| | Getter for the number of characters or number of objects.
|
| |
|
void | erase0 () |
| | Erases the fist character of the String.
|
| |
| void | replace (size_t p_pos, const std::string &p_src) |
| | Replaces characters at position p_pos.
|
| |
| virtual size_t | treeheight (size_t p_myheigth) const |
| | Tree Height.
|
| |
|
| SO (bool p_exec=false) |
| | Ctor.
|
| |
|
| SO (bool p_exec=false) |
| | Ctor.
|
| |
| virtual | ~SO ()=default |
| | Virtual dtor.
|
| |
|
bool | getExec () const |
| | Getter for exec_.
|
| |
|
void | setExec (bool p_exec) |
| | Setter for exec_.
|
| |
|
| Counter (Counter< SO > &&)=delete |
| |
|
Counter< SO > & | operator= (const Counter< SO > &)=delete |
| |
|
Counter< SO > & | operator= (Counter< SO > &&)=delete |
| |
|
| bool | invariant () const noexcept override |
| | Checks class invariants.
|
| |
|
| Counter () |
| | Ctor.
|
| |
|
| Counter (const Counter< SO > &) |
| | Copy ctor.
|
| |
|
| ~Counter () |
| | Dtor.
|
| |
|
|
std::shared_ptr< std::string > | str_ |
| | The string value.
|
| |
|
|
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 String.
- Invariant
- shared pointer is not null.
◆ clone()
| SOS * SOS::clone |
( |
| ) |
const |
|
inlineoverridevirtual |
Creates a new instance as copy with deep cloning.
- Postcondition
- return value != nullptr
-
return value maintains invariants
Reimplemented from SO.
◆ dup()
Creates a new instance as copy following the red book definition.
Implements SO.
◆ equal()
| bool SOS::equal |
( |
const SO * |
| ) |
const |
|
inlineoverridevirtual |
Equality.
Equality means: SOL und SOM are always equal.
For SOD and SOK, share_ptr<> points to the same object.
For SOA, share_ptr<> points to the same object, but empty arrays are equal nonetheless.
For SOO and SOo the function pointer must be the same.
Otherwise the value must be the same, even for SOS with shared_ptr<>.
- Returns
- bool ... true if the SO's are of the same type and equal
- See also
- Will be used directly and unchanged as operator eq
Implements SO.
◆ ge()
| bool SOS::ge |
( |
const SO * |
| ) |
const |
|
inlineoverridevirtual |
Greater or equal.
Will be overwritten for SOI, SOR, SOQ and SOS. The redundancy between equal(), gt() and ge() ist a matter of performance.
Reimplemented from SO.
◆ getSize()
| size_t SOS::getSize |
( |
| ) |
const |
|
inlineoverridevirtual |
Getter for the number of characters or number of objects.
Reimplemented from SO.
◆ gt()
| bool SOS::gt |
( |
const SO * |
| ) |
const |
|
inlineoverridevirtual |
Greater than.
Will be overwritten for SOI, SOR, SOQ and SOS. The redundancy between equal(), gt() and ge() ist a matter of performance.
Reimplemented from SO.
◆ invariant()
| bool SOS::invariant |
( |
| ) |
const |
|
inlineoverrideprotectedvirtualnoexcept |
Checks class invariants.
- Returns
- bool ... Indicates whether the class invariants are maintained.
Reimplemented from DbC.
◆ opequal()
| std::string SOS::opequal |
( |
| ) |
const |
|
inlineoverridevirtual |
For operators '=', 'cvs' and 'stack'.
Reimplemented from SOcomposite.
◆ opequalequal()
| std::string SOS::opequalequal |
( |
| ) |
const |
|
inlineoverridevirtual |
For operators '==' and 'pstack'.
This function attempts to produce a result that resembles the red book syntax for creating the object.
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.
◆ replace()
| void SOS::replace |
( |
size_t |
p_pos, |
|
|
const std::string & |
p_src |
|
) |
| |
|
inline |
Replaces characters at position p_pos.
- Precondition
- p_pos+p_src.size() <= this->size()
◆ setch()
| void SOS::setch |
( |
size_t |
p_index, |
|
|
int |
p_char |
|
) |
| |
Sets a single character within the string.
- Precondition
- p_index < stringsize
◆ type()
| std::string SOS::type |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns a type name.
- Returns
- std::string ... The type name of the instance.
Implements SO.
The documentation for this class was generated from the following files: