cpp-bencoding
|
Representation of an integer. More...
#include <BInteger.h>
Public Types | |
using | ValueType = int64_t |
Type of the underlying integral value. More... | |
Public Member Functions | |
ValueType | value () const |
Returns the integer's value. More... | |
void | setValue (ValueType value) |
Sets a new value. More... | |
BItemVisitor Support | |
virtual void | accept (BItemVisitor *visitor) override |
Accepts the item by the given visitor. More... | |
Public Member Functions inherited from bencoding::BItem | |
virtual | ~BItem ()=0 |
Destructs the item. More... | |
template<typename T > | |
std::shared_ptr< T > | as () |
Casts the item to the given subclass of BItem. More... | |
Static Public Member Functions | |
static std::unique_ptr< BInteger > | create (ValueType value) |
Creates and returns a new integer. More... | |
Private Member Functions | |
BInteger (ValueType value) | |
Constructs the integer with the given value. More... | |
Private Attributes | |
ValueType | _value |
Additional Inherited Members | |
Protected Member Functions inherited from bencoding::BItem | |
BItem () | |
Constructs the item. More... | |
Representation of an integer.
Use create() to create instances of the class.
using bencoding::BInteger::ValueType = int64_t |
Type of the underlying integral value.
|
explicitprivate |
Constructs the integer with the given value.
|
overridevirtual |
Accepts the item by the given visitor.
Subclasses should implement this function in this way:
Implements bencoding::BItem.
Creates and returns a new integer.
void bencoding::BInteger::setValue | ( | ValueType | value | ) |
Sets a new value.
auto bencoding::BInteger::value | ( | ) | const |
Returns the integer's value.
|
private |