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 
34 namespace memoryx
35 {
36 
37  class ProfilerMemorySnapshot;
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
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:46
memoryx::ProfilerEntity
Definition: ProfilerEntity.h:36
memoryx::ProfilerMemorySnapshot::~ProfilerMemorySnapshot
~ProfilerMemorySnapshot() override
Definition: ProfilerMemorySnapshot.cpp:59
memoryx::ProfilerMemorySnapshot::ProfilerMemorySnapshot
ProfilerMemorySnapshot()
Definition: ProfilerMemorySnapshot.cpp:35
memoryx::ProfilerMemorySnapshot::setStateName
void setStateName(const std::string &statename, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerMemorySnapshot.cpp:98
IceInternal::Handle< ProfilerMemorySnapshot >
memoryx::ProfilerMemorySnapshot::getStateName
std::string getStateName(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerMemorySnapshot.cpp:92
memoryx::ProfilerMemorySnapshot::getMemoryParameterMap
Ice::Context getMemoryParameterMap(const Ice::Current &context=Ice::emptyCurrent) const override
Definition: ProfilerMemorySnapshot.cpp:105
memoryx::ProfilerMemorySnapshot::clone
ProfilerMemorySnapshotPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Definition: ProfilerMemorySnapshot.cpp:83
memoryx::ProfilerMemorySnapshot
Definition: ProfilerMemorySnapshot.h:40
memoryx::ProfilerMemorySnapshot::setMemoryParameterMap
void setMemoryParameterMap(const Ice::Context &parameters, const Ice::Current &context=Ice::emptyCurrent) override
Definition: ProfilerMemorySnapshot.cpp:123
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:661
Entity.h
memoryx::ProfilerMemorySnapshot::ATTRIBUTE_STATENAME
static const std::string ATTRIBUTE_STATENAME
Definition: ProfilerMemorySnapshot.h:65
memoryx::ProfilerMemorySnapshot::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerMemorySnapshot &rhs)
Definition: ProfilerMemorySnapshot.h:75
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:66
ProfilerEntity.h