PLCnext API Documentation 25.0.2.69
Public Types | Public Member Functions | List of all members
Arp::Io::Commons::Configuration::TicConfiguration Class Reference

This class reads and stores a complete Tic hierarchy defined by a Tic links file. More...

#include <TicConfiguration.hpp>

Public Types

using RootPtr = std::shared_ptr< ITicSerializable >
 
using ChildPtr = std::shared_ptr< ITicSerializable >
 
using Roots = std::vector< RootPtr >
 
using BufferInfo = Arp::Io::Commons::Data::BufferInfo
 
using BufferInfos = std::vector< BufferInfo >
 
using PortDefinition = Arp::Plc::Meta::Commons::Io::PortDefinition
 
using PortDefinitions = std::vector< PortDefinition >
 

Public Member Functions

 TicConfiguration (const TicConfiguration &arg)=delete
 
 TicConfiguration (TicConfiguration &&arg) noexcept
 Default move constructor.
 
TicConfigurationoperator= (const TicConfiguration &arg)=delete
 
TicConfigurationoperator= (TicConfiguration &&arg) noexcept
 Default move-assignment operator.
 
virtual ~TicConfiguration (void)
 Default destructor.
 
 TicConfiguration (void)
 Default constructor.
 
const Roots & GetRoots (void) const
 Gets the root Tic elements. More...
 
const BufferInfos & GetBufferInfos (void) const
 Returns all available buffer informations. The buffer infos are sorted by the name. More...
 
const BufferInfoGetBufferInfo (const String &name) const
 Gets a specific BufferInfo. More...
 
bool TryGetBufferInfo (const String &name, BufferInfo &bufferInfo) const
 Tries to get a specific BufferInfo. More...
 
const PortDefinitions & GetPortDefinitions (void) const
 Returns a vector of all PortDefinition that are defined in tic data tree. More...
 
PortDefinitions GetPortDefinitions (const String &bufferName) const
 Returns all port definitions related to one specific buffer in a flat list. More...
 
void Load (const String &ticLinksPath)
 Loads the links file and all related Tic files. More...
 
virtual RootPtr CreateRoot (const String &rootElementName)
 Factory operation to create root elements. More...
 
virtual bool TryCreateCustomElement (const String &elementName, ChildPtr &result)
 Factory template method to create custom elements. More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 

Detailed Description

This class reads and stores a complete Tic hierarchy defined by a Tic links file.

The links file is loaded with TicConfiguration::Load. It reads all related Tic documents. Instances for the read root elements have to be created with the factory method CreateRoot. All documents which are related with the ArcRole::Parent are added as childs to the root element of the parent root node.

This class provides operations to enumerate over all buffer infos, or search for a specific buffer info, respectively.

Member Function Documentation

◆ CreateRoot()

TicConfiguration::RootPtr Arp::Io::Commons::Configuration::TicConfiguration::CreateRoot ( const String rootElementName)
virtual

Factory operation to create root elements.

This method is called every time a root element should be created. By default a TicBase element is created. If nullptr is returned the default element will be created.

Parameters
rootElementNameThe name of the root element to create.
Returns
The shared pointer to the new created root element.

◆ GetBufferInfo()

const TicConfiguration::BufferInfo & Arp::Io::Commons::Configuration::TicConfiguration::GetBufferInfo ( const String name) const

Gets a specific BufferInfo.

Parameters
nameThe name of the buffer to look for.
Returns
The buffer info with the given name.
Exceptions
ArgumentExceptionIf the buffer with the supplied name was not found.

◆ GetBufferInfos()

const TicConfiguration::BufferInfos & Arp::Io::Commons::Configuration::TicConfiguration::GetBufferInfos ( void  ) const

Returns all available buffer informations. The buffer infos are sorted by the name.

Returns
A list of all buffer infos.

◆ GetPortDefinitions() [1/2]

TicConfiguration::PortDefinitions Arp::Io::Commons::Configuration::TicConfiguration::GetPortDefinitions ( const String bufferName) const

Returns all port definitions related to one specific buffer in a flat list.

Parameters
bufferNameName of the buffer
Returns
Port definition list.

◆ GetPortDefinitions() [2/2]

const TicConfiguration::PortDefinitions & Arp::Io::Commons::Configuration::TicConfiguration::GetPortDefinitions ( void  ) const

Returns a vector of all PortDefinition that are defined in tic data tree.

Returns
Vector of all PortDefinition objects

◆ GetRoots()

const TicConfiguration::Roots & Arp::Io::Commons::Configuration::TicConfiguration::GetRoots ( void  ) const

Gets the root Tic elements.

Returns
The root Tic elements.

◆ Load()

void Arp::Io::Commons::Configuration::TicConfiguration::Load ( const String ticLinksPath)

Loads the links file and all related Tic files.

Parameters
ticLinksPathPath of the Tic links file to load.

◆ TryCreateCustomElement()

bool Arp::Io::Commons::Configuration::TicConfiguration::TryCreateCustomElement ( const String elementName,
ChildPtr &  result 
)
virtual

Factory template method to create custom elements.

This method is called to create custom tic elements if TicBase::TryCreateCustomElement returned false. If this methods returns false TicBase::TryCreateElement is called. If needed this methods has to be overriden by the derived class.

Parameters
elementNameThe name of the element to create.
resultThe created element
Returns
true</> if an element has been created.

◆ TryGetBufferInfo()

bool Arp::Io::Commons::Configuration::TicConfiguration::TryGetBufferInfo ( const String name,
BufferInfo bufferInfo 
) const

Tries to get a specific BufferInfo.

Parameters
nameThe name of the buffer to look for.
bufferInfoOut vale for found BufferINfo
Returns
True if buffer with name has been found
Exceptions
ArgumentExceptionIf the buffer with the supplied name was not found.

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