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

This class reads a single Tic document and stores its content. More...

#include <TicDocument.hpp>

Public Types

using Content = ITicSerializable
 
using ContentPtr = Content::Ptr
 

Public Member Functions

 TicDocument (const TicDocument &arg)=delete
 
 TicDocument (TicDocument &&arg) noexcept
 Default move constructor.
 
TicDocumentoperator= (const TicDocument &arg)=delete
 
TicDocumentoperator= (TicDocument &&arg) noexcept
 Default move-assignment operator.
 
virtual ~TicDocument (void)
 Default destructor.
 
 TicDocument (void)
 The default constructor creates an empty document.
 
const ContentGetContent (void) const
 Returns the content of this Tic document. More...
 
ContentPtr GetContentPtr (void) const noexcept
 Returns a pointer to the content More...
 
void Load (const String &filename)
 Loads the document while the root element is created through a call to CreateContent. More...
 
virtual ContentPtr CreateContent (const String &rootElementName)
 Creates the document content. More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 

Detailed Description

This class reads a single Tic document and stores its content.

Member Function Documentation

◆ CreateContent()

TicDocument::ContentPtr Arp::Io::Commons::Configuration::TicDocument::CreateContent ( const String rootElementName)
virtual

Creates the document content.

Parameters
rootElementNameThe name of the root element of the Tic document.
Returns
A shared pointer to the new created content.

The default implementation creates the content as an empty instance of TicBase. This operation should be overloaded to create specialized content, depending on the root element type.

◆ GetContent()

const TicDocument::Content & Arp::Io::Commons::Configuration::TicDocument::GetContent ( void  ) const

Returns the content of this Tic document.

Returns
The reference to the content
Exceptions
InvalidOperationExceptionIf the document was not loaded yet.

◆ GetContentPtr()

TicDocument::ContentPtr Arp::Io::Commons::Configuration::TicDocument::GetContentPtr ( void  ) const
noexcept

Returns a pointer to the content

Returns
The content pointer or nullptr if document was not loaded yet.

◆ Load()

void Arp::Io::Commons::Configuration::TicDocument::Load ( const String filename)

Loads the document while the root element is created through a call to CreateContent.

Parameters
filenameThe filename of the document to load.

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