lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | List of all members
lintel::Component Class Referenceabstract

#include <Component.h>

Inheritance diagram for lintel::Component:
lintel::DatabaseConnectionComponent lintel::EventBusComponent lintel::HistoryComponent lintel::HttpComponent lintel::LoggerComponent lintel::MessageQueueComponent lintel::ProcessComponent lintel::PropertyComponent lintel::PropertyRepositoryComponent lintel::SharedMemorySegmentComponent

Public Member Functions

 Component (std::string configRoot)
 
virtual ~Component ()=default
 
const std::string & getConfigRoot () const
 
virtual std::vector< std::shared_ptr< Entry > > parse (const std::string &content, int32_t lineOffset, const std::string &fileName)=0
 

Static Protected Member Functions

static std::size_t convertToBytes (const std::string &size)
 

Detailed Description

Base class for configuration parsing components

Constructor & Destructor Documentation

◆ Component()

lintel::Component::Component ( std::string  configRoot)
explicit

Construct a component with the given XML config root name

Parameters
configRootThe root element name

◆ ~Component()

virtual lintel::Component::~Component ( )
virtualdefault

Virtual destructor

Member Function Documentation

◆ convertToBytes()

static std::size_t lintel::Component::convertToBytes ( const std::string &  size)
staticprotected

Convert a human-readable size string to bytes

Parameters
sizeSize string (e.g. "10MB", "1GB")
Returns
Size in bytes

◆ getConfigRoot()

const std::string & lintel::Component::getConfigRoot ( ) const

Get the configuration root element name

Returns
The config root string

◆ parse()

virtual std::vector< std::shared_ptr< Entry > > lintel::Component::parse ( const std::string &  content,
int32_t  lineOffset,
const std::string &  fileName 
)
pure virtual

Parse configuration content and produce entries

Parameters
contentThe raw configuration content
fileNameThe source file name for error reporting
lineOffsetLine offset for error reporting
Returns
Vector of parsed configuration entries

Implemented in lintel::PropertyComponent, lintel::PropertyRepositoryComponent, lintel::DatabaseConnectionComponent, lintel::LoggerComponent, lintel::EventBusComponent, lintel::HistoryComponent, lintel::MessageQueueComponent, lintel::ProcessComponent, lintel::SharedMemorySegmentComponent, and lintel::HttpComponent.


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