52 return std::ctime(&st);
66 return "StatusValueTimestamp";
93 std::stringstream result;
94 ToStream(result, value, -1, showAll);
107 return "HAS_BINARY_BODY";
110 return "HAS_XML_BODY";
128 return "GreaterThan";
134 return "GreaterThanOrEqual";
137 return "LessThanOrEqual";
188 sprintf(buf,
"%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", guid.
Data1, guid.
Data2, guid.
Data3, guid.
Data4[0], guid.
Data4[1], guid.
Data4[2], guid.
Data4[3], guid.
Data4[4], guid.
Data4[5], guid.
Data4[6], guid.
Data4[7]);
212 std::stringstream result;
213 ToStream(result,
id, addObjectIdName);
288 return "BYTE_STRING";
291 return "XML_ELEMENT";
297 return "EXPANDED_NODE_Id";
300 return "STATUS_CODE";
303 return "QUALIFIED_NAME";
306 return "LOCALIZED_TEXT";
309 return "EXTENSION_OBJECT";
318 return "DIAGNOSTIC_INFO";
331 else if (!noSeparator)
345 os <<
"AggregateFilter(";
346 int subIndentLevel = (indentLevel < 0)
349 indent(os, subIndentLevel,
true);
357 os <<
"ContentFilterElement(";
358 int subIndentLevel = (indentLevel < 0)
362 indent(os, subIndentLevel,
true);
365 indent(os, subIndentLevel);
366 os <<
"FilterOperands: ";
369 indent(os, subIndentLevel,
true);
376 os <<
"DataChangeFilter(";
377 int subIndentLevel = (indentLevel < 0)
381 indent(os, subIndentLevel,
true);
384 indent(os, subIndentLevel);
387 indent(os, subIndentLevel);
390 indent(os, indentLevel,
true);
397 os <<
"ExtensionObjectHeader(";
398 int subIndentLevel = (indentLevel < 0)
402 indent(os, subIndentLevel,
true);
406 indent(os, subIndentLevel);
407 os <<
"Encoding: " << value.
Encoding;
409 indent(os, indentLevel,
true);
417 int subIndentLevel = (indentLevel < 0)
421 indent(os, subIndentLevel,
true);
425 indent(os, subIndentLevel);
426 os <<
"Time: " << value.
Time;
430 indent(os, subIndentLevel);
433 indent(os, subIndentLevel);
436 indent(os, subIndentLevel);
437 os <<
"EventId: " << value.
EventId;
439 indent(os, subIndentLevel);
443 indent(os, subIndentLevel);
444 os <<
"SourceNode: ";
447 indent(os, subIndentLevel);
448 os <<
"Severity: " << value.
Severity;
450 indent(os, subIndentLevel);
451 os <<
"Message: " << value.
Message;
453 indent(os, indentLevel,
true);
460 os <<
"EventFilter(";
461 int subIndentLevel = (indentLevel < 0)
465 indent(os, subIndentLevel,
true);
466 os <<
"SelectClauses: ";
469 indent(os, subIndentLevel);
470 os <<
"WhereClause: ";
473 indent(os, indentLevel,
true);
480 os <<
"FilterOperand(";
481 int subIndentLevel = (indentLevel < 0)
485 indent(os, subIndentLevel,
true);
489 indent(os, subIndentLevel);
490 os <<
"Element: ...";
493 indent(os, subIndentLevel);
494 os <<
"Literal: ...";
497 indent(os, subIndentLevel);
501 indent(os, subIndentLevel);
502 os <<
"SimpleAttribute: ";
505 indent(os, indentLevel,
true);
512 os <<
"MonitoredItemCreateRequest(";
513 int subIndentLevel = (indentLevel < 0)
517 indent(os, subIndentLevel,
true);
518 os <<
"ItemToMonitor: ";
521 indent(os, subIndentLevel);
524 indent(os, subIndentLevel);
525 os <<
"RequestedParameters: ";
528 indent(os, indentLevel,
true);
535 os <<
"MonitoredItemsParameters(";
536 int subIndentLevel = (indentLevel < 0)
540 indent(os, subIndentLevel,
true);
543 indent(os, subIndentLevel);
546 indent(os, subIndentLevel);
547 os <<
"ItemsToCreate: ";
550 indent(os, indentLevel,
true);
557 os <<
"MonitoringParameters(";
558 int subIndentLevel = (indentLevel < 0)
562 indent(os, subIndentLevel,
true);
565 indent(os, subIndentLevel,
true);
568 indent(os, subIndentLevel);
572 indent(os, subIndentLevel,
true);
575 indent(os, subIndentLevel,
true);
578 indent(os, indentLevel,
true);
585 os <<
"MonitoringFilter(";
586 int subIndentLevel = (indentLevel < 0)
590 indent(os, subIndentLevel,
true);
594 indent(os, subIndentLevel);
595 os <<
"DataChange: ";
598 indent(os, subIndentLevel);
602 indent(os, subIndentLevel);
606 indent(os, indentLevel,
true);
628 os <<
"i=" <<
id <<
";";
635 #ifndef __ENABLE_EMBEDDED_PROFILE__ 651 std::ostream &
OpcUa::ToStream(std::ostream & os,
const std::vector<OpcUa::QualifiedName> & value)
654 for (
auto element : value)
664 os << element.NamespaceIndex <<
":" << element.Name;
676 os <<
"ReadValueId(";
677 int subIndentLevel = (indentLevel < 0)
681 indent(os, subIndentLevel,
true);
682 os <<
"NodeId: " << value.
NodeId;
684 indent(os, subIndentLevel);
687 indent(os, subIndentLevel);
690 indent(os, subIndentLevel);
693 indent(os, indentLevel,
true);
700 os <<
"SimpleAttributeOperand(";
701 int subIndentLevel = (indentLevel < 0)
704 indent(os, subIndentLevel,
true);
707 indent(os, subIndentLevel);
708 os <<
"BrowsePath: ";
710 indent(os, subIndentLevel);
712 indent(os, subIndentLevel);
713 os <<
"IndexRange: ";
715 indent(os, indentLevel,
true);
722 if (str.size() != 36)
740 const int parts = sscanf(str.c_str(),
"%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
741 &data1, &data2, &data3, &data4, &data5, &data6, &data7, &data8, &data9, &data10, &data11);
743 guid.
Data1 =
static_cast<uint32_t
>(data1);
744 guid.
Data2 =
static_cast<uint16_t
>(data2);
745 guid.
Data3 =
static_cast<uint16_t
>(data3);
746 guid.
Data4[0] =
static_cast<uint8_t
>(data4);
747 guid.
Data4[1] =
static_cast<uint8_t
>(data5);
748 guid.
Data4[2] =
static_cast<uint8_t
>(data6);
749 guid.
Data4[3] =
static_cast<uint8_t
>(data7);
750 guid.
Data4[4] =
static_cast<uint8_t
>(data8);
751 guid.
Data4[5] =
static_cast<uint8_t
>(data9);
752 guid.
Data4[6] =
static_cast<uint8_t
>(data10);
753 guid.
Data4[7] =
static_cast<uint8_t
>(data11);
768 std::size_t colon = 0;
779 colon = data.find(field, colon);
782 if (colon == std::string::npos)
796 while (data[colon - 1] !=
';');
798 colon += std::strlen(field);
799 const std::size_t semicolon = data.find(
";", colon);
801 if (semicolon == std::string::npos)
806 return data.substr(colon, semicolon - colon);
816 return std::stoul(value);
824 uint32_t ns = defaultNamespace;
826 const std::string nsString = GetNodeField(data,
"ns=");
828 if (nsString.empty())
830 if (ns == std::numeric_limits<uint32_t>::max())
832 throw (std::runtime_error(
"Namespace index coult not be parsed from string and not default index specified in string: " + data));
838 ns = GetInteger(nsString);
841 const std::string srv = GetNodeField(data,
"srv=");
848 const std::string nsu = GetNodeField(data,
"nsu=");
855 const std::string integer = GetNodeField(data,
"i=");
857 if (!integer.empty())
876 throw (std::runtime_error(
"No identifier found in string: '" + data +
"'"));
881 std::size_t found = str.find(
":");
883 if (found != std::string::npos)
885 uint16_t ns = std::stoi(str.substr(0, found));
890 if (default_ns == std::numeric_limits<uint32_t>::max())
892 throw (std::runtime_error(
"Namespace index coult not be parsed from string and not default index specified in string: " + str));
uint32_t GetNamespaceIndex() const
ExtensionObjectHeader Header
std::vector< QualifiedName > BrowsePath
std::vector< std::string > IndexRange
OpcUa::QualifiedName DataEncoding
OpcUa::MonitoringFilter Filter
const char QualifiedName[]
std::vector< SimpleAttributeOperand > SelectClauses
Guid GetGuidIdentifier() const
bool HasNamespaceURI() const
static time_t ToTimeT(DateTime dateTime)
DataChangeFilter DataChange
void SetNamespaceURI(const std::string &uri)
uint32_t GetIntegerIdentifier() const
std::vector< ContentFilterElement > WhereClause
void SetServerIndex(uint32_t index)
std::string sprintf(CStringRef format, ArgList args)
std::ostream & indent(std::ostream &os, int level, bool noSeparator=false)
NodeId GuidNodeId(Guid value, uint16_t namespaceIndex=0)
std::ostream & ToStream(std::ostream &os, const AggregateFilter &value, int indentLevel=0)
Guid ToGuid(const std::string &str)
bool HasServerIndex() const
QualifiedName ToQualifiedName(const std::string &str, uint32_t default_ns=0)
SimpleAttributeOperand SimpleAttribute
NodeId ToNodeId(const std::string &str, uint32_t defaultNamespace=0)
AggregateFilter Aggregate
std::string ToString(const AttributeId &value)
NodeId StringNodeId(std::string value, uint16_t namespaceIndex=0)
std::vector< FilterOperand > FilterOperands
OpcUa::AttributeId AttributeId
OpcUa::MonitoringParameters RequestedParameters
OpcUa::ReadValueId ItemToMonitor
NodeId NumericNodeId(uint32_t value, uint16_t namespaceIndex=0)
DataChangeTrigger Trigger
ExtensionObjectHeader Header
std::string GetStringIdentifier() const
OpcUa::TimestampsToReturn TimestampsToReturn
OpcUa::MonitoringMode MonitoringMode
std::vector< OpcUa::MonitoredItemCreateRequest > ItemsToCreate