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 
32 namespace memoryx
33 {
34 
35  class ProfilerEvent;
37 
38  class ProfilerEvent :
39  virtual public memoryx::ProfilerEventBase,
40  virtual public memoryx::ProfilerEntity
41  {
42  public:
43  ProfilerEvent();
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
memoryx::ProfilerEvent::ProfilerEvent
ProfilerEvent()
Definition: ProfilerEvent.cpp:30
memoryx::ProfilerEvent::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: ProfilerEvent.cpp:75
memoryx::ProfilerEvent::setProfilerEvent
void setProfilerEvent(const armarx::ProfilerEvent &event)
Definition: ProfilerEvent.cpp:91
memoryx::ProfilerEvent::setExecutableName
void setExecutableName(const std::string &executableName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:121
memoryx::ProfilerEvent::setTimestamp
void setTimestamp(Ice::Int timestamp, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:133
memoryx::ProfilerEvent::getParentName
std::string getParentName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:164
memoryx::ProfilerEvent
Definition: ProfilerEvent.h:38
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
memoryx::ProfilerEvent::clone
ProfilerEntityPtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Definition: ProfilerEvent.cpp:81
memoryx::ProfilerEntity
Definition: ProfilerEntity.h:36
memoryx::ProfilerEvent::~ProfilerEvent
~ProfilerEvent() override
Definition: ProfilerEvent.cpp:52
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::ProfilerEvent::getTimestampUnit
std::string getTimestampUnit(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:139
memoryx::ProfilerEvent::getExecutableName
std::string getExecutableName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:115
memoryx::ProfilerEvent::setParentName
void setParentName(const std::string &parentName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:170
memoryx::ProfilerEvent::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ProfilerEvent &rhs)
Definition: ProfilerEvent.h:84
memoryx::ProfilerEvent::getPid
Ice::Int getPid(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:103
memoryx::ProfilerEvent::getTimestamp
Ice::Int getTimestamp(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:127
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:661
Entity.h
memoryx::ProfilerEvent::setTimestampUnit
void setTimestampUnit(const std::string &unit, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:145
memoryx::ProfilerEvent::getFunctionName
std::string getFunctionName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:176
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:917
memoryx::ProfilerEvent::setPid
void setPid(Ice::Int pid, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:109
memoryx::ProfilerEvent::setEventName
void setEventName(const std::string &eventName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProfilerEvent.cpp:157
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:182
memoryx::ProfilerEvent::getEventName
std::string getEventName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProfilerEvent.cpp:151
ProfilerEntity.h