humoto
Public Member Functions | Public Attributes | List of all members
humoto::Location Class Reference

Detailed Description

Location of a data chunk (offset + length).

Definition at line 146 of file utility.h.

#include <utility.h>

Public Member Functions

 Location ()
 Constructor. More...
 
 Location (const std::size_t offset, const std::size_t length)
 Construct location with given parameters. More...
 
bool checkLength (const std::size_t max_length) const
 Check length of location. More...
 
std::size_t end () const
 Offset of the element following the last element. More...
 
std::size_t front () const
 Offset of the first element. More...
 
void log (humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="location") const
 Log hierarchy as a set of tasks. More...
 
bool operator!= (const Location &another_location) const
 Compare two locations. More...
 
bool operator== (const Location &another_location) const
 Compare two locations. More...
 
void set (const std::size_t offset, const std::size_t length)
 Set location. More...
 

Public Attributes

std::size_t length_
 
std::size_t offset_
 

Constructor & Destructor Documentation

◆ Location() [1/2]

humoto::Location::Location ( )
inline

Constructor.

Definition at line 156 of file utility.h.

◆ Location() [2/2]

humoto::Location::Location ( const std::size_t  offset,
const std::size_t  length 
)
inline

Construct location with given parameters.

Parameters
[in]offsetoffset
[in]lengthlength

Definition at line 168 of file utility.h.

Member Function Documentation

◆ checkLength()

bool humoto::Location::checkLength ( const std::size_t  max_length) const
inline

Check length of location.

Parameters
[in]max_lengthmaximal length
Returns
true if location is valid

Definition at line 208 of file utility.h.

◆ end()

std::size_t humoto::Location::end ( ) const
inline

Offset of the element following the last element.

Returns
offset of the element following the last element (offset_ + length_)

Definition at line 231 of file utility.h.

◆ front()

std::size_t humoto::Location::front ( ) const
inline

Offset of the first element.

Returns
offset of the first element (offset_)

Definition at line 220 of file utility.h.

◆ log()

void humoto::Location::log ( humoto::Logger logger,
const LogEntryName parent = LogEntryName(),
const std::string &  name = "location" 
) const
inline

Log hierarchy as a set of tasks.

Parameters
[in,out]loggerlogger
[in]parentparent
[in]namename

Definition at line 257 of file utility.h.

◆ operator!=()

bool humoto::Location::operator!= ( const Location another_location) const
inline

Compare two locations.

Parameters
[in]another_locationsome other location
Returns
true/false

Definition at line 195 of file utility.h.

◆ operator==()

bool humoto::Location::operator== ( const Location another_location) const
inline

Compare two locations.

Parameters
[in]another_locationsome other location
Returns
true/false

Definition at line 181 of file utility.h.

◆ set()

void humoto::Location::set ( const std::size_t  offset,
const std::size_t  length 
)
inline

Set location.

Parameters
[in]offsetoffset
[in]lengthlength

Definition at line 243 of file utility.h.

Member Data Documentation

◆ length_

std::size_t humoto::Location::length_

Definition at line 150 of file utility.h.

◆ offset_

std::size_t humoto::Location::offset_

Definition at line 149 of file utility.h.


The documentation for this class was generated from the following file: