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
28#include <MemoryX/interface/core/EntityBase.h>
29#include <MemoryX/interface/memorytypes/ProfilerEntities.h>
30
31namespace memoryx
32{
35
37 virtual public memoryx::ResourceProfileEntityBase,
38 virtual public memoryx::Entity
39 {
40 public:
42 ResourceProfileEntity(const StatisticMeasuresBasePtr& duration,
43 const StatisticMeasuresBasePtr& cpuUsage,
44 const StatisticMeasuresBasePtr& memoryUsage);
46 ~ResourceProfileEntity() override;
47
48
49 // cloning
50 Ice::ObjectPtr ice_clone() const override;
51 ResourceProfileEntityPtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
52
53 StatisticMeasuresBasePtr
54 getDuration(const Ice::Current& c = Ice::emptyCurrent) const override;
55 void setDuration(const StatisticMeasuresBasePtr& duration,
56 const Ice::Current& c = Ice::emptyCurrent) override;
57
58 StatisticMeasuresBasePtr
59 getCpuUsage(const Ice::Current& c = Ice::emptyCurrent) const override;
60 void setCpuUsage(const StatisticMeasuresBasePtr& cpuUsage,
61 const Ice::Current& c = Ice::emptyCurrent) override;
62
63 StatisticMeasuresBasePtr
64 getMemoryUsage(const Ice::Current& c = Ice::emptyCurrent) const override;
65 void setMemoryUsage(const StatisticMeasuresBasePtr& memoryUsage,
66 const Ice::Current& c = Ice::emptyCurrent) override;
67
68 private:
69 void output(std::ostream& stream) const;
70 void initializeAttributes();
71
72 static const std::string DURATION;
73 static const std::string CPU_USAGE;
74 static const std::string MEMORY_USAGE;
75
76 public:
77 // streaming operator
78 friend std::ostream&
79 operator<<(std::ostream& stream, const ResourceProfileEntity& rhs)
80 {
81 rhs.output(stream);
82 return stream;
83 }
84
85 friend std::ostream&
86 operator<<(std::ostream& stream, const ResourceProfileEntityPtr& rhs)
87 {
88 rhs->output(stream);
89 return stream;
90 }
91
92 friend std::ostream&
93 operator<<(std::ostream& stream, const ResourceProfileEntityBasePtr& rhs)
94 {
95 stream << ResourceProfileEntityPtr::dynamicCast(rhs);
96 return stream;
97 }
98 };
99
100} // namespace memoryx
constexpr T c
Entity is the superclass for all MemoryX memory chunks.
Definition Entity.h:246
ResourceProfileEntityPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
StatisticMeasuresBasePtr getCpuUsage(const Ice::Current &c=Ice::emptyCurrent) const override
StatisticMeasuresBasePtr getDuration(const Ice::Current &c=Ice::emptyCurrent) const override
void setMemoryUsage(const StatisticMeasuresBasePtr &memoryUsage, const Ice::Current &c=Ice::emptyCurrent) override
StatisticMeasuresBasePtr getMemoryUsage(const Ice::Current &c=Ice::emptyCurrent) const override
friend std::ostream & operator<<(std::ostream &stream, const ResourceProfileEntity &rhs)
Ice::ObjectPtr ice_clone() const override
void setCpuUsage(const StatisticMeasuresBasePtr &cpuUsage, const Ice::Current &c=Ice::emptyCurrent) override
void setDuration(const StatisticMeasuresBasePtr &duration, const Ice::Current &c=Ice::emptyCurrent) override
VirtualRobot headers.
IceInternal::Handle< ResourceProfileEntity > ResourceProfileEntityPtr