ProfilerTransition.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package MemoryX::Core::MemoryTypes
19  * @author Manfred Kroehnert (Manfred dot Kroehnert at kit dot edu)
20  * @date 2015
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 #include "ProfilerEntity.h"
29 #include <MemoryX/interface/core/EntityBase.h>
30 #include <MemoryX/interface/memorytypes/ProfilerEntities.h>
31 
32 namespace memoryx
33 {
34 
35  class ProfilerTransition;
37 
39  virtual public memoryx::ProfilerTransitionBase,
40  virtual public memoryx::ProfilerEntity
41  {
42  public:
44  ProfilerTransition(const std::string& parentStateName,
45  const std::string& sourceStateName,
46  const std::string& targetStateName,
47  const EntityRefBasePtr& sourceStateMemorySnapshotRef,
48  const EntityRefBasePtr& targetStateMemorySnapshotRef,
49  Ice::Int count);
51  ~ProfilerTransition() override;
52 
53 
54  // cloning
55  Ice::ObjectPtr ice_clone() const override;
56  ProfilerTransitionPtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
57 
58  // interface
59  std::string
60  getParentStateName(const Ice::Current& context = Ice::emptyCurrent) const override;
61  void setParentStateName(const std::string& statename,
62  const Ice::Current& context = Ice::emptyCurrent) override;
63 
64  std::string
65  getSourceStateName(const Ice::Current& context = Ice::emptyCurrent) const override;
66  void setSourceStateName(const std::string& statename,
67  const Ice::Current& context = Ice::emptyCurrent) override;
68  std::string
69  getTargetStateName(const Ice::Current& context = Ice::emptyCurrent) const override;
70  void setTargetStateName(const std::string& statename,
71  const Ice::Current& context = Ice::emptyCurrent) override;
72 
73  EntityRefBasePtr getSourceStateMemorySnapshotRef(
74  const Ice::Current& context = Ice::emptyCurrent) const override;
75  void
76  setSourceStateMemorySnapshotRef(const EntityRefBasePtr& memorySnapshotRef,
77  const Ice::Current& context = Ice::emptyCurrent) override;
78  EntityRefBasePtr getTargetStateMemorySnapshotRef(
79  const Ice::Current& context = Ice::emptyCurrent) const override;
80  void
81  setTargetStateMemorySnapshotRef(const EntityRefBasePtr& memorySnapshotRef,
82  const Ice::Current& context = Ice::emptyCurrent) override;
83 
84  Ice::Int getCount(const Ice::Current& context = Ice::emptyCurrent) const override;
85  void setCount(Ice::Int count, const Ice::Current& context = Ice::emptyCurrent) override;
86 
87  /**
88  * @brief equalsMemorySnapshotIDs returns true if the ProfilerMemorySnapshot IDs asssocited with this transition are equal to the passed in parameters.
89  * @param sourceSnapshotID
90  * @param targetSnapshotID
91  * @return
92  */
93  bool memorySnapshotIdsEqual(const std::string& sourceSnapshotID,
94  const std::string& targetSnapshotID);
95 
96  private:
97  void output(std::ostream& stream) const;
98  void initializeAttributes();
99 
100  public:
101  // streaming operator
102  friend std::ostream&
103  operator<<(std::ostream& stream, const ProfilerTransition& rhs)
104  {
105  rhs.output(stream);
106  return stream;
107  }
108 
109  friend std::ostream&
110  operator<<(std::ostream& stream, const ProfilerTransitionPtr& rhs)
111  {
112  rhs->output(stream);
113  return stream;
114  }
115 
116  friend std::ostream&
117  operator<<(std::ostream& stream, const ProfilerTransitionBasePtr& rhs)
118  {
119  stream << ProfilerTransitionPtr::dynamicCast(rhs);
120  return stream;
121  }
122  };
123 
124 } // namespace memoryx
memoryx::ProfilerTransition::setSourceStateName
void setSourceStateName(const std::string &statename, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerTransition.cpp:127
memoryx::ProfilerTransition::getParentStateName
std::string getParentStateName(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:107
memoryx::ProfilerTransition::getCount
Ice::Int getCount(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:173
memoryx::ProfilerTransition::setTargetStateMemorySnapshotRef
void setTargetStateMemorySnapshotRef(const EntityRefBasePtr &memorySnapshotRef, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerTransition.cpp:166
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
memoryx::ProfilerTransition::setSourceStateMemorySnapshotRef
void setSourceStateMemorySnapshotRef(const EntityRefBasePtr &memorySnapshotRef, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerTransition.cpp:153
memoryx::ProfilerTransition::getSourceStateMemorySnapshotRef
EntityRefBasePtr getSourceStateMemorySnapshotRef(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:147
memoryx::ProfilerEntity
Definition: ProfilerEntity.h:36
memoryx::ProfilerTransition::setTargetStateName
void setTargetStateName(const std::string &statename, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerTransition.cpp:140
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::ProfilerTransition::ProfilerTransition
ProfilerTransition()
Definition: ProfilerTransition.cpp:32
memoryx::ProfilerTransition::setParentStateName
void setParentStateName(const std::string &statename, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerTransition.cpp:113
memoryx::ProfilerTransition::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerTransition &rhs)
Definition: ProfilerTransition.h:103
memoryx::ProfilerTransition::~ProfilerTransition
~ProfilerTransition() override
Definition: ProfilerTransition.cpp:70
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:661
memoryx::ProfilerTransition::getSourceStateName
std::string getSourceStateName(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:121
Entity.h
memoryx::ProfilerTransition::getTargetStateName
std::string getTargetStateName(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:134
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:917
memoryx::ProfilerTransition::clone
ProfilerTransitionPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Definition: ProfilerTransition.cpp:98
memoryx::ProfilerTransition::memorySnapshotIdsEqual
bool memorySnapshotIdsEqual(const std::string &sourceSnapshotID, const std::string &targetSnapshotID)
equalsMemorySnapshotIDs returns true if the ProfilerMemorySnapshot IDs asssocited with this transitio...
Definition: ProfilerTransition.cpp:185
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
memoryx::ProfilerTransition
Definition: ProfilerTransition.h:38
memoryx::ProfilerTransition::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: ProfilerTransition.cpp:92
memoryx::ProfilerTransition::getTargetStateMemorySnapshotRef
EntityRefBasePtr getTargetStateMemorySnapshotRef(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:160
ProfilerEntity.h
memoryx::ProfilerTransition::setCount
void setCount(Ice::Int count, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerTransition.cpp:179