ProfilerMemorySnapshot.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 <string>
28
29#include "ProfilerEntity.h"
31#include <MemoryX/interface/core/EntityBase.h>
32#include <MemoryX/interface/memorytypes/ProfilerEntities.h>
33
34namespace memoryx
35{
36
39
41 virtual public memoryx::ProfilerMemorySnapshotBase,
42 virtual public memoryx::ProfilerEntity
43 {
44 public:
46 ProfilerMemorySnapshot(const std::string& stateName, const Ice::Context& parameters);
48 ~ProfilerMemorySnapshot() override;
49
50
51 // cloning
52 Ice::ObjectPtr ice_clone() const override;
53 ProfilerMemorySnapshotPtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
54
55 // interface
56 std::string getStateName(const Ice::Current& context = Ice::emptyCurrent) const override;
57 void setStateName(const std::string& statename,
58 const Ice::Current& context = Ice::emptyCurrent) override;
59
60 Ice::Context
61 getMemoryParameterMap(const Ice::Current& context = Ice::emptyCurrent) const override;
62 void setMemoryParameterMap(const Ice::Context& parameters,
63 const Ice::Current& context = Ice::emptyCurrent) override;
64
65 static const std::string ATTRIBUTE_STATENAME;
66 static const std::string ATTRIBUTE_MEMORYPARAMETERS;
67
68 private:
69 void output(std::ostream& stream) const;
70 void initializeAttributes();
71
72 public:
73 // streaming operator
74 friend std::ostream&
75 operator<<(std::ostream& stream, const ProfilerMemorySnapshot& rhs)
76 {
77 rhs.output(stream);
78 return stream;
79 }
80
81 friend std::ostream&
82 operator<<(std::ostream& stream, const ProfilerMemorySnapshotPtr& rhs)
83 {
84 rhs->output(stream);
85 return stream;
86 }
87
88 friend std::ostream&
89 operator<<(std::ostream& stream, const ProfilerMemorySnapshotBasePtr& rhs)
90 {
91 stream << ProfilerMemorySnapshotPtr::dynamicCast(rhs);
92 return stream;
93 }
94 };
95
96} // namespace memoryx
constexpr T c
ProfilerMemorySnapshotPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
void setStateName(const std::string &statename, const Ice::Current &context=Ice::emptyCurrent) override
void setMemoryParameterMap(const Ice::Context &parameters, const Ice::Current &context=Ice::emptyCurrent) override
static const std::string ATTRIBUTE_STATENAME
friend std::ostream & operator<<(std::ostream &stream, const ProfilerMemorySnapshot &rhs)
static const std::string ATTRIBUTE_MEMORYPARAMETERS
std::string getStateName(const Ice::Current &context=Ice::emptyCurrent) const override
Ice::ObjectPtr ice_clone() const override
Ice::Context getMemoryParameterMap(const Ice::Current &context=Ice::emptyCurrent) const override
VirtualRobot headers.
IceInternal::Handle< ProfilerMemorySnapshot > ProfilerMemorySnapshotPtr