DMPEntity.cpp
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @package MemoryX::Core
17* @author Alexey Kozlov ( kozlov at kit dot edu)
18* @date 2012
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#include "DMPEntity.h"
24
26
27namespace memoryx
28{
29
31 {
32 // EntityAttributePtr parentClassesAttr = new EntityAttribute("parentClasses");
33 // putAttribute(parentClassesAttr);
34 setName("");
35 setId("");
36 }
37
39 IceUtil::Shared(source),
40 ::armarx::Serializable(source),
41 EntityBase(), // dont copy
42 DMPEntityBase(source),
43 Entity(source)
44 {
45 }
46
47 DMPEntity::DMPEntity(const std::string& name, const std::string& id)
48 {
49 setName(name);
50 setId(id);
51 }
52
54 {
55 // TODO Auto-generated destructor stub
56 }
57
58 void
59 DMPEntity::setDMPName(const std::string& dmpName, const Ice::Current&)
60 {
61 putAttribute("DMPName", dmpName);
62 }
63
64 void
65 DMPEntity::setDMPType(const std::string& dmpType, const Ice::Current&)
66 {
67 putAttribute("DMPType", dmpType);
68 }
69
70 void
71 DMPEntity::setDMPtextStr(const std::string& textdmp, const Ice::Current&)
72 {
73 putAttribute("DMPtextStr", textdmp);
74 }
75
76 void
77 DMPEntity::set3rdOrder(const bool is3rdOrder, const Ice::Current&)
78 {
79 putAttribute("3rdOrder", is3rdOrder);
80 }
81
82 void
83 DMPEntity::setTrajDim(const int trajdim, const ::Ice::Current&)
84 {
85 putAttribute("TrajDim", trajdim);
86 }
87
88 std::string
89 DMPEntity::getDMPName(const Ice::Current&) const
90 {
91 return getAttributeValue("DMPName")->getString();
92 }
93
94 int
95 DMPEntity::getDMPType(const Ice::Current&) const
96 {
97 return getAttributeValue("DMPType")->getInt();
98 }
99
100 std::string
101 DMPEntity::getDMPtextStr(const Ice::Current&) const
102 {
103 return getAttributeValue("DMPtextStr")->getString();
104 }
105
106 bool
107 DMPEntity::get3rdOrder(const Ice::Current&) const
108 {
109 return getAttributeValue("3rdOrder")->getBool();
110 }
111
112 int
113 DMPEntity::getTrajDim(const Ice::Current&) const
114 {
115 return getAttributeValue("TrajDim")->getInt();
116 }
117
118 void
119 DMPEntity::output(std::ostream& stream) const
120 {
121 Entity::output(stream);
122 }
123
124 Ice::ObjectPtr
126 {
127 return this->clone();
128 }
129
131 DMPEntity::clone(const Ice::Current& c) const
132 {
133 std::shared_lock lock1(entityMutex);
134 std::scoped_lock lock2(attributesMutex);
135 std::scoped_lock lock3(wrappersMutex);
136 DMPEntityPtr ret = new DMPEntity(*this);
137 return ret;
138 }
139
140
141} // namespace memoryx
constexpr T c
bool get3rdOrder(const ::Ice::Current &=Ice::emptyCurrent) const override
DMPEntityPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
void set3rdOrder(const bool is3rdOrder, const ::Ice::Current &=Ice::emptyCurrent) override
Definition DMPEntity.cpp:77
void setDMPName(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
Definition DMPEntity.cpp:59
void setDMPType(const std::string &dmpType, const ::Ice::Current &=Ice::emptyCurrent) override
Definition DMPEntity.cpp:65
std::string getDMPtextStr(const ::Ice::Current &=Ice::emptyCurrent) const override
int getDMPType(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition DMPEntity.cpp:95
Ice::ObjectPtr ice_clone() const override
void setDMPtextStr(const std::string &dmptext, const ::Ice::Current &=Ice::emptyCurrent) override
Definition DMPEntity.cpp:71
std::string getDMPName(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition DMPEntity.cpp:89
int getTrajDim(const ::Ice::Current &=Ice::emptyCurrent) const override
~DMPEntity() override
Definition DMPEntity.cpp:53
void setTrajDim(const int trajdim, const ::Ice::Current &=Ice::emptyCurrent) override
Definition DMPEntity.cpp:83
void setId(const ::std::string &id, const ::Ice::Current &=Ice::emptyCurrent) override
Set id of this entity.
Definition Entity.cpp:174
void setName(const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
Set name of this entity.
Definition Entity.cpp:188
Entity(const Entity &source)
Definition Entity.cpp:34
virtual armarx::VariantPtr getAttributeValue(const ::std::string &attrName) const
Retrieve value of an attribute from entity.
Definition Entity.cpp:327
std::mutex attributesMutex
Definition Entity.h:524
std::recursive_mutex wrappersMutex
Definition Entity.h:526
void output(std::ostream &stream) const
Definition Entity.cpp:436
void putAttribute(const ::memoryx::EntityAttributeBasePtr &attr, const ::Ice::Current &=Ice::emptyCurrent) override
Store attribute in entity.
Definition Entity.cpp:347
std::shared_mutex entityMutex
Definition Entity.h:525
This file offers overloads of toIce() and fromIce() functions for STL container types.
VirtualRobot headers.
IceInternal::Handle< DMPEntity > DMPEntityPtr
Definition DMPEntity.h:35