ResourceProfileEntity.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 Lesser 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.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 #include <MemoryX/interface/core/EntityBase.h>
28 #include <MemoryX/interface/memorytypes/ProfilerEntities.h>
30 
31 namespace memoryx
32 {
33  class ResourceProfileEntity;
35 
37  virtual public memoryx::ResourceProfileEntityBase,
38  virtual public memoryx::Entity
39  {
40  public:
42  ResourceProfileEntity(const StatisticMeasuresBasePtr& duration, const StatisticMeasuresBasePtr& cpuUsage, const StatisticMeasuresBasePtr& memoryUsage);
44  ~ResourceProfileEntity() override;
45 
46 
47  // cloning
48  Ice::ObjectPtr ice_clone() const override;
49  ResourceProfileEntityPtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
50 
51  StatisticMeasuresBasePtr getDuration(const Ice::Current& c = Ice::emptyCurrent) const override;
52  void setDuration(const StatisticMeasuresBasePtr& duration, const Ice::Current& c = Ice::emptyCurrent) override;
53 
54  StatisticMeasuresBasePtr getCpuUsage(const Ice::Current& c = Ice::emptyCurrent) const override;
55  void setCpuUsage(const StatisticMeasuresBasePtr& cpuUsage, const Ice::Current& c = Ice::emptyCurrent) override;
56 
57  StatisticMeasuresBasePtr getMemoryUsage(const Ice::Current& c = Ice::emptyCurrent) const override;
58  void setMemoryUsage(const StatisticMeasuresBasePtr& memoryUsage, const Ice::Current& c = Ice::emptyCurrent) override;
59  private:
60  void output(std::ostream& stream) const;
61  void initializeAttributes();
62 
63  static const std::string DURATION;
64  static const std::string CPU_USAGE;
65  static const std::string MEMORY_USAGE;
66 
67  public:
68  // streaming operator
69  friend std::ostream& operator<<(std::ostream& stream, const ResourceProfileEntity& rhs)
70  {
71  rhs.output(stream);
72  return stream;
73  }
74 
75  friend std::ostream& operator<<(std::ostream& stream, const ResourceProfileEntityPtr& rhs)
76  {
77  rhs->output(stream);
78  return stream;
79  }
80 
81  friend std::ostream& operator<<(std::ostream& stream, const ResourceProfileEntityBasePtr& rhs)
82  {
83  stream << ResourceProfileEntityPtr::dynamicCast(rhs);
84  return stream;
85  }
86  };
87 
88 }
89 
memoryx::ResourceProfileEntity::ResourceProfileEntity
ResourceProfileEntity()
Definition: ResourceProfileEntity.cpp:37
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
memoryx::ResourceProfileEntity::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ResourceProfileEntityBasePtr &rhs)
Definition: ResourceProfileEntity.h:81
memoryx::ResourceProfileEntity::getCpuUsage
StatisticMeasuresBasePtr getCpuUsage(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ResourceProfileEntity.cpp:113
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::ResourceProfileEntity::getDuration
StatisticMeasuresBasePtr getDuration(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ResourceProfileEntity.cpp:103
memoryx::ResourceProfileEntity::~ResourceProfileEntity
~ResourceProfileEntity() override
Definition: ResourceProfileEntity.cpp:77
memoryx::ResourceProfileEntity::clone
ResourceProfileEntityPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Definition: ResourceProfileEntity.cpp:94
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
memoryx::ResourceProfileEntity::setDuration
void setDuration(const StatisticMeasuresBasePtr &duration, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ResourceProfileEntity.cpp:108
memoryx::ResourceProfileEntity::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: ResourceProfileEntity.cpp:88
Entity.h
memoryx::ResourceProfileEntity::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ResourceProfileEntityPtr &rhs)
Definition: ResourceProfileEntity.h:75
memoryx::ResourceProfileEntity::getMemoryUsage
StatisticMeasuresBasePtr getMemoryUsage(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ResourceProfileEntity.cpp:123
memoryx::ResourceProfileEntity
Definition: ResourceProfileEntity.h:36
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
memoryx::ResourceProfileEntity::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ResourceProfileEntity &rhs)
Definition: ResourceProfileEntity.h:69
memoryx::Entity
Definition: Entity.h:246
memoryx::ResourceProfileEntity::setCpuUsage
void setCpuUsage(const StatisticMeasuresBasePtr &cpuUsage, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ResourceProfileEntity.cpp:118
memoryx::ResourceProfileEntity::setMemoryUsage
void setMemoryUsage(const StatisticMeasuresBasePtr &memoryUsage, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ResourceProfileEntity.cpp:128