8#include "Arp/System/Commons/Configuration/TicReader.hpp"
9#include "Arp/System/Commons/Configuration/TicSerializationContext.hpp"
10namespace Arp {
namespace System {
namespace Commons {
namespace Configuration
14template<
class TContent>
18 typedef TContent Content;
19 typedef typename TContent::Ptr ContentPtr;
20 typedef std::shared_ptr<TicConfigDocument<TContent>> Ptr;
29 const String& GetDocumentFilename(
void)
const;
30 ContentPtr GetContent(
void);
33 void Load(
const String& filename);
42 ContentPtr contentPtr;
50 : contentPtr(contentPtrArg)
53 if (this->contentPtr ==
nullptr)
55 this->contentPtr = ContentPtr(
new Content());
62 return this->contentPtr;
66inline const String& TicConfigDocument<T>::GetDocumentFilename(
void)
const
68 return this->documentFilename;
72inline void TicConfigDocument<T>::Load(
const String& filename)
74 TicReader reader = TicReader::Create(filename);
75 TicSerializationContext context(reader);
77 this->documentFilename = filename;
78 context.SetFilePath(filename);
81 reader.GetXmlReader().ReadStartElement(
"TIC");
83 context.ReadDocumentContext(reader);
85 this->contentPtr->ReadTic(reader, context);
87 reader.GetXmlReader().ReadEndElement();
Definition: TicConfigDocument.hxx:16
TicConfigDocument(ContentPtr contentPtr=nullptr)
Constructs an TicConfigDocument instance.
Definition: TicConfigDocument.hxx:49
~TicConfigDocument(void)=default
Destructs this instance and frees all resouces.
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API