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 
27 namespace memoryx
28 {
29 
31  {
32  // EntityAttributePtr parentClassesAttr = new EntityAttribute("parentClasses");
33  // putAttribute(parentClassesAttr);
34  setName("");
35  setId("");
36 
37  }
38 
40  IceUtil::Shared(source),
41  ::armarx::Serializable(source),
42  EntityBase(),// dont copy
43  DMPEntityBase(source),
44  Entity(source)
45  {
46 
47  }
48 
49  DMPEntity::DMPEntity(const std::string& name, const std::string& id)
50  {
51  setName(name);
52  setId(id);
53  }
54 
56  {
57  // TODO Auto-generated destructor stub
58  }
59 
60  void DMPEntity::setDMPName(const std::string& dmpName, const Ice::Current&)
61  {
62  putAttribute("DMPName", dmpName);
63  }
64 
65  void DMPEntity::setDMPType(const std::string& dmpType, const Ice::Current&)
66  {
67  putAttribute("DMPType", dmpType);
68  }
69 
70  void DMPEntity::setDMPtextStr(const std::string& textdmp, const Ice::Current&)
71  {
72  putAttribute("DMPtextStr", textdmp);
73  }
74 
75  void DMPEntity::set3rdOrder(const bool is3rdOrder, const Ice::Current&)
76  {
77  putAttribute("3rdOrder", is3rdOrder);
78  }
79 
80  void DMPEntity::setTrajDim(const int trajdim, const ::Ice::Current&)
81  {
82  putAttribute("TrajDim", trajdim);
83  }
84 
85 
86  std::string DMPEntity::getDMPName(const Ice::Current&) const
87  {
88  return getAttributeValue("DMPName")->getString();
89  }
90 
91  int DMPEntity::getDMPType(const Ice::Current&) const
92  {
93  return getAttributeValue("DMPType")->getInt();
94  }
95 
96  std::string DMPEntity::getDMPtextStr(const Ice::Current&) const
97  {
98  return getAttributeValue("DMPtextStr")->getString();
99  }
100 
101  bool DMPEntity::get3rdOrder(const Ice::Current&) const
102  {
103  return getAttributeValue("3rdOrder")->getBool();
104  }
105 
106  int DMPEntity::getTrajDim(const Ice::Current&) const
107  {
108  return getAttributeValue("TrajDim")->getInt();
109  }
110 
111  void DMPEntity::output(std::ostream& stream) const
112  {
113  Entity::output(stream);
114  }
115 
117  {
118  return this->clone();
119  }
120 
121  DMPEntityPtr DMPEntity::clone(const Ice::Current& c) const
122  {
123  std::shared_lock lock1(entityMutex);
124  std::scoped_lock lock2(attributesMutex);
125  std::scoped_lock lock3(wrappersMutex);
126  DMPEntityPtr ret = new DMPEntity(*this);
127  return ret;
128  }
129 
130 
131 }
132 
133 
armarx::aron::ret
ReaderT::InputType T & ret
Definition: rw.h:21
memoryx::DMPEntity::DMPEntity
DMPEntity()
Definition: DMPEntity.cpp:30
memoryx::Entity::putAttribute
void putAttribute(const ::memoryx::EntityAttributeBasePtr &attr, const ::Ice::Current &=Ice::emptyCurrent) override
Store attribute in entity.
Definition: Entity.cpp:327
memoryx::DMPEntity::clone
DMPEntityPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Definition: DMPEntity.cpp:121
AbstractObjectSerializer.h
memoryx::DMPEntity::setDMPType
void setDMPType(const std::string &dmpType, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: DMPEntity.cpp:65
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
memoryx::DMPEntity::setDMPtextStr
void setDMPtextStr(const std::string &dmptext, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: DMPEntity.cpp:70
memoryx::DMPEntity::setDMPName
void setDMPName(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: DMPEntity.cpp:60
IceUtil
Definition: Instance.h:21
memoryx::Entity::output
void output(std::ostream &stream) const
Definition: Entity.cpp:409
memoryx::Entity::getAttributeValue
virtual armarx::VariantPtr getAttributeValue(const ::std::string &attrName) const
Retrieve value of an attribute from entity.
Definition: Entity.cpp:308
memoryx::DMPEntity::getDMPName
std::string getDMPName(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: DMPEntity.cpp:86
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::DMPEntity
Definition: DMPEntity.h:37
memoryx::DMPEntity::~DMPEntity
~DMPEntity() override
Definition: DMPEntity.cpp:55
memoryx::Entity::attributesMutex
std::mutex attributesMutex
Definition: Entity.h:504
memoryx::DMPEntity::setTrajDim
void setTrajDim(const int trajdim, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: DMPEntity.cpp:80
DMPEntity.h
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
memoryx::Entity::setId
void setId(const ::std::string &id, const ::Ice::Current &=Ice::emptyCurrent) override
Set id of this entity.
Definition: Entity.cpp:167
memoryx::Entity::entityMutex
std::shared_mutex entityMutex
Definition: Entity.h:505
memoryx::DMPEntity::getDMPtextStr
std::string getDMPtextStr(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: DMPEntity.cpp:96
memoryx::DMPEntity::getTrajDim
int getTrajDim(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: DMPEntity.cpp:106
memoryx::DMPEntity::set3rdOrder
void set3rdOrder(const bool is3rdOrder, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: DMPEntity.cpp:75
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
memoryx::DMPEntity::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: DMPEntity.cpp:116
memoryx::Entity
Definition: Entity.h:246
memoryx::Entity::setName
void setName(const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
Set name of this entity.
Definition: Entity.cpp:179
memoryx::DMPEntity::getDMPType
int getDMPType(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: DMPEntity.cpp:91
memoryx::Entity::wrappersMutex
std::recursive_mutex wrappersMutex
Definition: Entity.h:506
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
memoryx::DMPEntity::get3rdOrder
bool get3rdOrder(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: DMPEntity.cpp:101