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 
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 
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
armarx::aron::ret
ReaderT::InputType T & ret
Definition: rw.h:13
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:347
memoryx::DMPEntity::clone
DMPEntityPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Definition: DMPEntity.cpp:131
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:46
memoryx::DMPEntity::setDMPtextStr
void setDMPtextStr(const std::string &dmptext, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: DMPEntity.cpp:71
memoryx::DMPEntity::setDMPName
void setDMPName(const std::string &dmpName, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: DMPEntity.cpp:59
IceUtil
Definition: Instance.h:21
memoryx::Entity::output
void output(std::ostream &stream) const
Definition: Entity.cpp:436
memoryx::Entity::getAttributeValue
virtual armarx::VariantPtr getAttributeValue(const ::std::string &attrName) const
Retrieve value of an attribute from entity.
Definition: Entity.cpp:327
memoryx::DMPEntity::getDMPName
std::string getDMPName(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: DMPEntity.cpp:89
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::DMPEntity
Definition: DMPEntity.h:37
memoryx::DMPEntity::~DMPEntity
~DMPEntity() override
Definition: DMPEntity.cpp:53
memoryx::Entity::attributesMutex
std::mutex attributesMutex
Definition: Entity.h:524
memoryx::DMPEntity::setTrajDim
void setTrajDim(const int trajdim, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: DMPEntity.cpp:83
DMPEntity.h
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:661
memoryx::Entity::setId
void setId(const ::std::string &id, const ::Ice::Current &=Ice::emptyCurrent) override
Set id of this entity.
Definition: Entity.cpp:174
memoryx::Entity::entityMutex
std::shared_mutex entityMutex
Definition: Entity.h:525
memoryx::DMPEntity::getDMPtextStr
std::string getDMPtextStr(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: DMPEntity.cpp:101
memoryx::DMPEntity::getTrajDim
int getTrajDim(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: DMPEntity.cpp:113
memoryx::DMPEntity::set3rdOrder
void set3rdOrder(const bool is3rdOrder, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: DMPEntity.cpp:77
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:125
memoryx::Entity
Definition: Entity.h:245
memoryx::Entity::setName
void setName(const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
Set name of this entity.
Definition: Entity.cpp:188
memoryx::DMPEntity::getDMPType
int getDMPType(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: DMPEntity.cpp:95
memoryx::Entity::wrappersMutex
std::recursive_mutex wrappersMutex
Definition: Entity.h:526
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
memoryx::DMPEntity::get3rdOrder
bool get3rdOrder(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: DMPEntity.cpp:107