ProfilerEvent.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"
29#include <MemoryX/interface/core/EntityBase.h>
30#include <MemoryX/interface/memorytypes/ProfilerEntities.h>
31
32namespace memoryx
33{
34
35 class ProfilerEvent;
37
39 virtual public memoryx::ProfilerEventBase,
40 virtual public memoryx::ProfilerEntity
41 {
42 public:
44 ProfilerEvent(const armarx::ProfilerEvent& event);
46 ~ProfilerEvent() override;
47
48
49 // cloning
50 Ice::ObjectPtr ice_clone() const override;
51 ProfilerEntityPtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
52
53 // interface
54 void setProfilerEvent(const armarx::ProfilerEvent& event);
55
56 Ice::Int getPid(const Ice::Current& c = Ice::emptyCurrent) const override;
57 void setPid(Ice::Int pid, const Ice::Current& c = Ice::emptyCurrent) override;
58 std::string getExecutableName(const Ice::Current& c = Ice::emptyCurrent) const override;
59 void setExecutableName(const std::string& executableName,
60 const Ice::Current& c = Ice::emptyCurrent) override;
61 Ice::Int getTimestamp(const Ice::Current& c = Ice::emptyCurrent) const override;
62 void setTimestamp(Ice::Int timestamp, const Ice::Current& c = Ice::emptyCurrent) override;
63 std::string getTimestampUnit(const Ice::Current& c = Ice::emptyCurrent) const override;
64 void setTimestampUnit(const std::string& unit,
65 const Ice::Current& c = Ice::emptyCurrent) override;
66 std::string getEventName(const Ice::Current& c = Ice::emptyCurrent) const override;
67 void setEventName(const std::string& eventName,
68 const Ice::Current& c = Ice::emptyCurrent) override;
69 std::string getParentName(const Ice::Current& c = Ice::emptyCurrent) const override;
70 void setParentName(const std::string& parentName,
71 const Ice::Current& c = Ice::emptyCurrent) override;
72 std::string getFunctionName(const Ice::Current& c = Ice::emptyCurrent) const override;
73 void setFunctionName(const std::string& functionName,
74 const Ice::Current& c = Ice::emptyCurrent) override;
75
76 private:
77 void output(std::ostream& stream) const;
78
79 void initializeAttributes();
80
81 public:
82 // streaming operator
83 friend std::ostream&
84 operator<<(std::ostream& stream, const ProfilerEvent& rhs)
85 {
86 rhs.output(stream);
87 return stream;
88 }
89
90 friend std::ostream&
91 operator<<(std::ostream& stream, const ProfilerEventPtr& rhs)
92 {
93 rhs->output(stream);
94 return stream;
95 }
96
97 friend std::ostream&
98 operator<<(std::ostream& stream, const ProfilerEventBasePtr& rhs)
99 {
100 stream << ProfilerEventPtr::dynamicCast(rhs);
101 return stream;
102 }
103 };
104
105} // namespace memoryx
std::string timestamp()
constexpr T c
std::string getTimestampUnit(const Ice::Current &c=Ice::emptyCurrent) const override
void setTimestampUnit(const std::string &unit, const Ice::Current &c=Ice::emptyCurrent) override
void setTimestamp(Ice::Int timestamp, const Ice::Current &c=Ice::emptyCurrent) override
std::string getFunctionName(const Ice::Current &c=Ice::emptyCurrent) const override
std::string getParentName(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::Int getPid(const Ice::Current &c=Ice::emptyCurrent) const override
ProfilerEntityPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
void setFunctionName(const std::string &functionName, const Ice::Current &c=Ice::emptyCurrent) override
friend std::ostream & operator<<(std::ostream &stream, const ProfilerEvent &rhs)
Ice::ObjectPtr ice_clone() const override
void setParentName(const std::string &parentName, const Ice::Current &c=Ice::emptyCurrent) override
void setPid(Ice::Int pid, const Ice::Current &c=Ice::emptyCurrent) override
std::string getEventName(const Ice::Current &c=Ice::emptyCurrent) const override
void setExecutableName(const std::string &executableName, const Ice::Current &c=Ice::emptyCurrent) override
std::string getExecutableName(const Ice::Current &c=Ice::emptyCurrent) const override
void setProfilerEvent(const armarx::ProfilerEvent &event)
Ice::Int getTimestamp(const Ice::Current &c=Ice::emptyCurrent) const override
void setEventName(const std::string &eventName, const Ice::Current &c=Ice::emptyCurrent) override
VirtualRobot headers.
IceInternal::Handle< ProfilerEvent > ProfilerEventPtr
IceInternal::Handle< ProfilerEntity > ProfilerEntityPtr