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
32namespace memoryx
33{
34
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
constexpr T c
Ice::Int getCount(const Ice::Current &context=Ice::emptyCurrent) const override
bool memorySnapshotIdsEqual(const std::string &sourceSnapshotID, const std::string &targetSnapshotID)
equalsMemorySnapshotIDs returns true if the ProfilerMemorySnapshot IDs asssocited with this transitio...
std::string getParentStateName(const Ice::Current &context=Ice::emptyCurrent) const override
void setCount(Ice::Int count, const Ice::Current &context=Ice::emptyCurrent) override
friend std::ostream & operator<<(std::ostream &stream, const ProfilerTransition &rhs)
EntityRefBasePtr getTargetStateMemorySnapshotRef(const Ice::Current &context=Ice::emptyCurrent) const override
void setSourceStateName(const std::string &statename, const Ice::Current &context=Ice::emptyCurrent) override
EntityRefBasePtr getSourceStateMemorySnapshotRef(const Ice::Current &context=Ice::emptyCurrent) const override
std::string getSourceStateName(const Ice::Current &context=Ice::emptyCurrent) const override
Ice::ObjectPtr ice_clone() const override
void setSourceStateMemorySnapshotRef(const EntityRefBasePtr &memorySnapshotRef, const Ice::Current &context=Ice::emptyCurrent) override
void setParentStateName(const std::string &statename, const Ice::Current &context=Ice::emptyCurrent) override
void setTargetStateMemorySnapshotRef(const EntityRefBasePtr &memorySnapshotRef, const Ice::Current &context=Ice::emptyCurrent) override
std::string getTargetStateName(const Ice::Current &context=Ice::emptyCurrent) const override
ProfilerTransitionPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
void setTargetStateName(const std::string &statename, const Ice::Current &context=Ice::emptyCurrent) override
VirtualRobot headers.
IceInternal::Handle< ProfilerTransition > ProfilerTransitionPtr