Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F376140
Agent.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Size
1 KB
Referenced Files
None
Subscribers
None
Agent.cpp
View Options
//===-- core/Agent.cpp ------------------------------------------*- C++ -*-===//
//
// The RoSA Framework
//
// Distributed under the terms and conditions of the Boost Software License 1.0.
// See accompanying file LICENSE.
//
// If you did not receive a copy of the license file, see
// http://www.boost.org/LICENSE_1_0.txt.
//
//===----------------------------------------------------------------------===//
///
/// \file core/Agent.cpp
///
/// \author David Juhasz (david.juhasz@tuwien.ac.at)
///
/// \date 2017
///
/// \brief Implementation of rosa/core/Agent.hpp.
///
//===----------------------------------------------------------------------===//
#include
"rosa/core/Agent.hpp"
namespace
rosa
{
Agent
::~
Agent
(
void
)
{
LOG_TRACE
(
"Destroying Agent..."
);
}
Agent
::
operator
bool
(
void
)
const
noexcept
{
// An Agent itself is always valid.
return
true
;
}
bool
Agent
::
operator
==
(
const
AgentHandle
&
H
)
const
noexcept
{
// Return if the \c rosa::Agent wrapped by \p H is this very object.
return
this
==
&
H
.
A
;
}
bool
Agent
::
operator
<
(
const
AgentHandle
&
H
)
const
noexcept
{
// Compare memory addresses.
return
this
<
&
H
.
A
;
}
AgentHandle
Agent
::
self
(
void
)
noexcept
{
return
Self
;
}
void
Agent
::
sendMessage
(
message_t
&&
M
)
noexcept
{
system
().
send
(
Self
,
std
::
move
(
M
));
}
std
::
string
Agent
::
dump
(
void
)
const
noexcept
{
LOG_TRACE
(
"Dumping Agent '"
+
FullName
+
"'"
);
return
"[Agent] "
+
FullName
;
}
MessagingSystem
&
Agent
::
system
(
void
)
const
noexcept
{
// \note The \c rosa::System the \c rosa::Unit is created with is a
// \c rosa::MessagingSystem.
return
static_cast
<
MessagingSystem
&>
(
Unit
::
system
());
}
}
// End namespace rosa
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sun, Jun 8, 7:36 PM (22 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
150403
Default Alt Text
Agent.cpp (1 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline
Log In to Comment