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"
28 
29 #include <MemoryX/interface/core/EntityBase.h>
30 #include <MemoryX/interface/memorytypes/ProfilerEntities.h>
32 
33 
34 namespace memoryx
35 {
36 
37  class ProfilerEvent;
39 
40  class ProfilerEvent :
41  virtual public memoryx::ProfilerEventBase,
42  virtual public memoryx::ProfilerEntity
43  {
44  public:
45  ProfilerEvent();
46  ProfilerEvent(const armarx::ProfilerEvent& event);
48  ~ProfilerEvent() override;
49 
50 
51  // cloning
52  Ice::ObjectPtr ice_clone() const override;
53  ProfilerEntityPtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
54 
55  // interface
56  void setProfilerEvent(const armarx::ProfilerEvent& event);
57 
58  Ice::Int getPid(const Ice::Current& c = Ice::emptyCurrent) const override;
59  void setPid(Ice::Int pid, const Ice::Current& c = Ice::emptyCurrent) override;
60  std::string getExecutableName(const Ice::Current& c = Ice::emptyCurrent) const override;
61  void setExecutableName(const std::string& executableName, const Ice::Current& c = Ice::emptyCurrent) override;
62  Ice::Int getTimestamp(const Ice::Current& c = Ice::emptyCurrent) const override;
63  void setTimestamp(Ice::Int timestamp, const Ice::Current& c = Ice::emptyCurrent) override;
64  std::string getTimestampUnit(const Ice::Current& c = Ice::emptyCurrent) const override;
65  void setTimestampUnit(const std::string& unit, 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, const Ice::Current& c = Ice::emptyCurrent) override;
68  std::string getParentName(const Ice::Current& c = Ice::emptyCurrent) const override;
69  void setParentName(const std::string& parentName, const Ice::Current& c = Ice::emptyCurrent) override;
70  std::string getFunctionName(const Ice::Current& c = Ice::emptyCurrent) const override;
71  void setFunctionName(const std::string& functionName, const Ice::Current& c = Ice::emptyCurrent) override;
72  private:
73  void output(std::ostream& stream) const;
74 
75  void initializeAttributes();
76 
77  public:
78  // streaming operator
79  friend std::ostream& operator<<(std::ostream& stream, const ProfilerEvent& rhs)
80  {
81  rhs.output(stream);
82  return stream;
83  }
84 
85  friend std::ostream& operator<<(std::ostream& stream, const ProfilerEventPtr& rhs)
86  {
87  rhs->output(stream);
88  return stream;
89  }
90 
91  friend std::ostream& operator<<(std::ostream& stream, const ProfilerEventBasePtr& rhs)
92  {
93  stream << ProfilerEventPtr::dynamicCast(rhs);
94  return stream;
95  }
96  };
97 
98 }
99 
memoryx::ProfilerEvent::ProfilerEvent
ProfilerEvent()
Definition: ProfilerEvent.cpp:31
memoryx::ProfilerEvent::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerEventBasePtr &rhs)
Definition: ProfilerEvent.h:91
memoryx::ProfilerEvent::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: ProfilerEvent.cpp:80
memoryx::ProfilerEvent::setProfilerEvent
void setProfilerEvent(const armarx::ProfilerEvent &event)
Definition: ProfilerEvent.cpp:95
memoryx::ProfilerEvent::setExecutableName
void setExecutableName(const std::string &executableName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:125
memoryx::ProfilerEvent::setTimestamp
void setTimestamp(Ice::Int timestamp, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:137
memoryx::ProfilerEvent::getParentName
std::string getParentName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:168
memoryx::ProfilerEvent
Definition: ProfilerEvent.h:40
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
memoryx::ProfilerEvent::clone
ProfilerEntityPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Definition: ProfilerEvent.cpp:86
memoryx::ProfilerEntity
Definition: ProfilerEntity.h:36
memoryx::ProfilerEvent::~ProfilerEvent
~ProfilerEvent() override
Definition: ProfilerEvent.cpp:57
memoryx::ProfilerEvent::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerEventPtr &rhs)
Definition: ProfilerEvent.h:85
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::ProfilerEvent::getTimestampUnit
std::string getTimestampUnit(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:143
memoryx::ProfilerEvent::getExecutableName
std::string getExecutableName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:119
memoryx::ProfilerEvent::setParentName
void setParentName(const std::string &parentName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:174
memoryx::ProfilerEvent::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerEvent &rhs)
Definition: ProfilerEvent.h:79
memoryx::ProfilerEvent::getPid
Ice::Int getPid(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:107
memoryx::ProfilerEvent::getTimestamp
Ice::Int getTimestamp(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:131
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
Entity.h
memoryx::ProfilerEvent::setTimestampUnit
void setTimestampUnit(const std::string &unit, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:149
memoryx::ProfilerEvent::getFunctionName
std::string getFunctionName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:180
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:916
memoryx::ProfilerEvent::setPid
void setPid(Ice::Int pid, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:113
memoryx::ProfilerEvent::setEventName
void setEventName(const std::string &eventName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:161
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
memoryx::ProfilerEvent::setFunctionName
void setFunctionName(const std::string &functionName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:186
memoryx::ProfilerEvent::getEventName
std::string getEventName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:155
ProfilerEntity.h