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 "ProfilerEntity.h"
28 
29 #include <MemoryX/interface/core/EntityBase.h>
30 #include <MemoryX/interface/memorytypes/ProfilerEntities.h>
32 
33 #include <string>
34 
35 namespace memoryx
36 {
37 
38  class ProfilerMemorySnapshot;
40 
42  virtual public memoryx::ProfilerMemorySnapshotBase,
43  virtual public memoryx::ProfilerEntity
44  {
45  public:
47  ProfilerMemorySnapshot(const std::string& stateName, const Ice::Context& parameters);
49  ~ProfilerMemorySnapshot() override;
50 
51 
52  // cloning
53  Ice::ObjectPtr ice_clone() const override;
54  ProfilerMemorySnapshotPtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
55 
56  // interface
57  std::string getStateName(const Ice::Current& context = Ice::emptyCurrent) const override;
58  void setStateName(const std::string& statename, const Ice::Current& context = Ice::emptyCurrent) override;
59 
60  Ice::Context getMemoryParameterMap(const Ice::Current& context = Ice::emptyCurrent) const override;
61  void setMemoryParameterMap(const Ice::Context& parameters, const Ice::Current& context = Ice::emptyCurrent) override;
62 
63  static const std::string ATTRIBUTE_STATENAME;
64  static const std::string ATTRIBUTE_MEMORYPARAMETERS;
65 
66  private:
67  void output(std::ostream& stream) const;
68  void initializeAttributes();
69 
70  public:
71  // streaming operator
72  friend std::ostream& operator<<(std::ostream& stream, const ProfilerMemorySnapshot& rhs)
73  {
74  rhs.output(stream);
75  return stream;
76  }
77 
78  friend std::ostream& operator<<(std::ostream& stream, const ProfilerMemorySnapshotPtr& rhs)
79  {
80  rhs->output(stream);
81  return stream;
82  }
83 
84  friend std::ostream& operator<<(std::ostream& stream, const ProfilerMemorySnapshotBasePtr& rhs)
85  {
86  stream << ProfilerMemorySnapshotPtr::dynamicCast(rhs);
87  return stream;
88  }
89  };
90 
91 }
92 
memoryx::ProfilerMemorySnapshot::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: ProfilerMemorySnapshot.cpp:77
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
memoryx::ProfilerEntity
Definition: ProfilerEntity.h:36
memoryx::ProfilerMemorySnapshot::~ProfilerMemorySnapshot
~ProfilerMemorySnapshot() override
Definition: ProfilerMemorySnapshot.cpp:60
memoryx::ProfilerMemorySnapshot::ProfilerMemorySnapshot
ProfilerMemorySnapshot()
Definition: ProfilerMemorySnapshot.cpp:37
memoryx::ProfilerMemorySnapshot::setStateName
void setStateName(const std::string &statename, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerMemorySnapshot.cpp:95
IceInternal::Handle< ProfilerMemorySnapshot >
memoryx::ProfilerMemorySnapshot::getStateName
std::string getStateName(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerMemorySnapshot.cpp:90
memoryx::ProfilerMemorySnapshot::getMemoryParameterMap
Ice::Context getMemoryParameterMap(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerMemorySnapshot.cpp:101
memoryx::ProfilerMemorySnapshot::clone
ProfilerMemorySnapshotPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Definition: ProfilerMemorySnapshot.cpp:82
memoryx::ProfilerMemorySnapshot::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerMemorySnapshotPtr &rhs)
Definition: ProfilerMemorySnapshot.h:78
memoryx::ProfilerMemorySnapshot
Definition: ProfilerMemorySnapshot.h:41
memoryx::ProfilerMemorySnapshot::setMemoryParameterMap
void setMemoryParameterMap(const Ice::Context &parameters, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerMemorySnapshot.cpp:117
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
Entity.h
memoryx::ProfilerMemorySnapshot::ATTRIBUTE_STATENAME
static const std::string ATTRIBUTE_STATENAME
Definition: ProfilerMemorySnapshot.h:63
memoryx::ProfilerMemorySnapshot::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerMemorySnapshot &rhs)
Definition: ProfilerMemorySnapshot.h:72
memoryx::ProfilerMemorySnapshot::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerMemorySnapshotBasePtr &rhs)
Definition: ProfilerMemorySnapshot.h:84
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
memoryx::ProfilerMemorySnapshot::ATTRIBUTE_MEMORYPARAMETERS
static const std::string ATTRIBUTE_MEMORYPARAMETERS
Definition: ProfilerMemorySnapshot.h:64
ProfilerEntity.h