Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve perfomance of Inforamtion Model #120

Merged
merged 14 commits into from
Mar 2, 2019
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ build_*
.vs
*.json
pki
test.xml
tst/data/opc.ua.roby_save.xml
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ Release 3.7.0

* refactoring application service interface #65, by @huebl
* add simple getter to password of UserNameIdentityToken #108, by @flipback
* improve performance of Information Model #120, by @flipback

**Bugs**:

* User change was not implemented in session #105, by @huebl
* fix changing user in the same OPC UA session #105, by @huebl

Release 3.6.1 (2018-12-28)
------------------------------------------------------------
Expand Down
24 changes: 18 additions & 6 deletions src/OpcUaStackServer/AddressSpaceModel/ReferenceItem.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2015 Kai Huebl ([email protected])
Copyright 2015-2019 Kai Huebl ([email protected])

Lizenziert gemäß Apache Licence Version 2.0 (die „Lizenz“); Nutzung dieser
Datei nur in Übereinstimmung mit der Lizenz erlaubt.
Expand All @@ -12,7 +12,7 @@
Informationen über die jeweiligen Bedingungen für Genehmigungen und Einschränkungen
im Rahmen der Lizenz finden Sie in der Lizenz.

Autor: Kai Huebl ([email protected])
Autor: Kai Huebl ([email protected]), Aleksey Timin ([email protected])
*/

#include "OpcUaStackServer/AddressSpaceModel/ReferenceItem.h"
Expand All @@ -21,13 +21,22 @@ namespace OpcUaStackServer
{

ReferenceItem::ReferenceItem(void)
: isForward_(false)
: typeId_()
, isForward_(false)
, nodeId_()
{
}

ReferenceItem::ReferenceItem(const bool& isForward, const OpcUaNodeId& nodeId)
: isForward_(isForward)
: typeId_()
, isForward_(isForward)
, nodeId_(nodeId)
{
}

ReferenceItem::ReferenceItem(const OpcUaNodeId& typeId, const bool& isForward, const OpcUaNodeId& nodeId)
: typeId_(typeId)
, isForward_(isForward)
, nodeId_(nodeId)
{
}
Expand All @@ -37,22 +46,25 @@ namespace OpcUaStackServer
}

void
ReferenceItem::copyTo(ReferenceItem::SPtr referenceItem)
ReferenceItem::copyTo(ReferenceItem::SPtr& referenceItem)
{
copyTo(*referenceItem);
}

void
ReferenceItem::copyTo(ReferenceItem& referenceItem)
{
typeId_.copyTo(referenceItem.typeId_);
nodeId_.copyTo(referenceItem.nodeId_);
referenceItem.isForward_ = isForward_;
}

bool
ReferenceItem::operator==(const ReferenceItem& referenceItem)
{
return nodeId_ == referenceItem.nodeId_ && isForward_ == referenceItem.isForward_;
return typeId_ == referenceItem.typeId_
&& nodeId_ == referenceItem.nodeId_
&& isForward_ == referenceItem.isForward_;
}

}
9 changes: 6 additions & 3 deletions src/OpcUaStackServer/AddressSpaceModel/ReferenceItem.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2015 Kai Huebl ([email protected])
Copyright 2015-2019 Kai Huebl ([email protected])

Lizenziert gemäß Apache Licence Version 2.0 (die „Lizenz“); Nutzung dieser
Datei nur in Übereinstimmung mit der Lizenz erlaubt.
Expand All @@ -12,7 +12,7 @@
Informationen über die jeweiligen Bedingungen für Genehmigungen und Einschränkungen
im Rahmen der Lizenz finden Sie in der Lizenz.

Autor: Kai Huebl ([email protected])
Autor: Kai Huebl ([email protected]), Aleksey Timin ([email protected])
*/

#ifndef __OpcUaStackServer_ReferenceItem_h__
Expand All @@ -37,14 +37,17 @@ namespace OpcUaStackServer

ReferenceItem(void);
ReferenceItem(const bool& isForward, const OpcUaNodeId& nodeId);
ReferenceItem(const OpcUaNodeId& typeId, const bool& isForward, const OpcUaNodeId& nodeId);
~ReferenceItem(void);

void copyTo(ReferenceItem::SPtr referenceItem);
void copyTo(ReferenceItem::SPtr& referenceItem);
void copyTo(ReferenceItem& referenceItem);
bool operator==(const ReferenceItem& referenceItem);

OpcUaNodeId typeId_;
OpcUaNodeId nodeId_;
bool isForward_;

};

}
Expand Down
Loading