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"
28 
29 #include <MemoryX/interface/core/EntityBase.h>
30 #include <MemoryX/interface/memorytypes/ProfilerEntities.h>
32 
33 namespace memoryx
34 {
35 
36  class ProfilerTransition;
38 
40  virtual public memoryx::ProfilerTransitionBase,
41  virtual public memoryx::ProfilerEntity
42  {
43  public:
45  ProfilerTransition(const std::string& parentStateName, const std::string& sourceStateName, const std::string& targetStateName, const EntityRefBasePtr& sourceStateMemorySnapshotRef, const EntityRefBasePtr& targetStateMemorySnapshotRef, Ice::Int count);
47  ~ProfilerTransition() override;
48 
49 
50  // cloning
51  Ice::ObjectPtr ice_clone() const override;
52  ProfilerTransitionPtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
53 
54  // interface
55  std::string getParentStateName(const Ice::Current& context = Ice::emptyCurrent) const override;
56  void setParentStateName(const std::string& statename, const Ice::Current& context = Ice::emptyCurrent) override;
57 
58  std::string getSourceStateName(const Ice::Current& context = Ice::emptyCurrent) const override;
59  void setSourceStateName(const std::string& statename, const Ice::Current& context = Ice::emptyCurrent) override;
60  std::string getTargetStateName(const Ice::Current& context = Ice::emptyCurrent) const override;
61  void setTargetStateName(const std::string& statename, const Ice::Current& context = Ice::emptyCurrent) override;
62 
63  EntityRefBasePtr getSourceStateMemorySnapshotRef(const Ice::Current& context = Ice::emptyCurrent) const override;
64  void setSourceStateMemorySnapshotRef(const EntityRefBasePtr& memorySnapshotRef, const Ice::Current& context = Ice::emptyCurrent) override;
65  EntityRefBasePtr getTargetStateMemorySnapshotRef(const Ice::Current& context = Ice::emptyCurrent) const override;
66  void setTargetStateMemorySnapshotRef(const EntityRefBasePtr& memorySnapshotRef, const Ice::Current& context = Ice::emptyCurrent) override;
67 
68  Ice::Int getCount(const Ice::Current& context = Ice::emptyCurrent) const override;
69  void setCount(Ice::Int count, const Ice::Current& context = Ice::emptyCurrent) override;
70 
71  /**
72  * @brief equalsMemorySnapshotIDs returns true if the ProfilerMemorySnapshot IDs asssocited with this transition are equal to the passed in parameters.
73  * @param sourceSnapshotID
74  * @param targetSnapshotID
75  * @return
76  */
77  bool memorySnapshotIdsEqual(const std::string& sourceSnapshotID, const std::string& targetSnapshotID);
78 
79  private:
80  void output(std::ostream& stream) const;
81  void initializeAttributes();
82 
83  public:
84  // streaming operator
85  friend std::ostream& operator<<(std::ostream& stream, const ProfilerTransition& rhs)
86  {
87  rhs.output(stream);
88  return stream;
89  }
90 
91  friend std::ostream& operator<<(std::ostream& stream, const ProfilerTransitionPtr& rhs)
92  {
93  rhs->output(stream);
94  return stream;
95  }
96 
97  friend std::ostream& operator<<(std::ostream& stream, const ProfilerTransitionBasePtr& rhs)
98  {
99  stream << ProfilerTransitionPtr::dynamicCast(rhs);
100  return stream;
101  }
102  };
103 
104 }
105 
memoryx::ProfilerTransition::setSourceStateName
void setSourceStateName(const std::string &statename, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerTransition.cpp:117
memoryx::ProfilerTransition::getParentStateName
std::string getParentStateName(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:100
memoryx::ProfilerTransition::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerTransitionPtr &rhs)
Definition: ProfilerTransition.h:91
memoryx::ProfilerTransition::getCount
Ice::Int getCount(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:154
memoryx::ProfilerTransition::setTargetStateMemorySnapshotRef
void setTargetStateMemorySnapshotRef(const EntityRefBasePtr &memorySnapshotRef, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerTransition.cpp:148
memoryx::ProfilerTransition::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerTransitionBasePtr &rhs)
Definition: ProfilerTransition.h:97
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
memoryx::ProfilerTransition::setSourceStateMemorySnapshotRef
void setSourceStateMemorySnapshotRef(const EntityRefBasePtr &memorySnapshotRef, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerTransition.cpp:138
memoryx::ProfilerTransition::getSourceStateMemorySnapshotRef
EntityRefBasePtr getSourceStateMemorySnapshotRef(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:133
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:127
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::ProfilerTransition::ProfilerTransition
ProfilerTransition()
Definition: ProfilerTransition.cpp:33
memoryx::ProfilerTransition::setParentStateName
void setParentStateName(const std::string &statename, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerTransition.cpp:105
memoryx::ProfilerTransition::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerTransition &rhs)
Definition: ProfilerTransition.h:85
memoryx::ProfilerTransition::~ProfilerTransition
~ProfilerTransition() override
Definition: ProfilerTransition.cpp:66
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
memoryx::ProfilerTransition::getSourceStateName
std::string getSourceStateName(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:112
Entity.h
memoryx::ProfilerTransition::getTargetStateName
std::string getTargetStateName(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:122
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:916
memoryx::ProfilerTransition::clone
ProfilerTransitionPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Definition: ProfilerTransition.cpp:92
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:164
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
memoryx::ProfilerTransition
Definition: ProfilerTransition.h:39
memoryx::ProfilerTransition::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: ProfilerTransition.cpp:87
memoryx::ProfilerTransition::getTargetStateMemorySnapshotRef
EntityRefBasePtr getTargetStateMemorySnapshotRef(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerTransition.cpp:143
ProfilerEntity.h
memoryx::ProfilerTransition::setCount
void setCount(Ice::Int count, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerTransition.cpp:159