Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1497479
AgentHandle.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Size
1 KB
Referenced Files
None
Subscribers
None
AgentHandle.cpp
View Options
//===-- core/AgentHandle.cpp ------------------------------------*- C++ -*-===//
//
// The RoSA Framework
//
//===----------------------------------------------------------------------===//
///
/// \file core/AgentHandle.cpp
///
/// \author David Juhasz (david.juhasz@tuwien.ac.at)
///
/// \date 2017
///
/// \brief Implementation of rosa/core/AgentHandle.hpp.
///
//===----------------------------------------------------------------------===//
#include
"rosa/core/AgentHandle.hpp"
#include
"rosa/core/Agent.hpp"
namespace
rosa
{
AgentHandle
::
AgentHandle
(
Agent
&
A
,
bool
)
noexcept
:
A
(
A
),
S
(
A
.
system
())
{}
AgentHandle
::
AgentHandle
(
Agent
&
A
)
:
A
(
A
),
S
(
A
.
system
())
{
ASSERT
(
S
.
isUnitRegistered
(
A
));
}
AgentHandle
::
operator
bool
(
void
)
const
noexcept
{
// \note The referred \c rosa::MessageSystem is supposed to be still alive.
return
S
.
isUnitRegistered
(
A
);
}
bool
AgentHandle
::
operator
==
(
const
AgentHandle
&
H
)
const
noexcept
{
// Return if the referred \c rosa::Agent is the same object in both
// \c rosa::AgentHandler instances.
return
&
A
==
&
H
.
A
;
}
bool
AgentHandle
::
operator
<
(
const
AgentHandle
&
H
)
const
noexcept
{
// Compare memory addresses of the referred \c rosa::Agent instances.
return
&
A
<
&
H
.
A
;
}
AgentHandle
AgentHandle
::
self
(
void
)
noexcept
{
// Return a copy of \p this object.
return
*
this
;
}
void
AgentHandle
::
sendMessage
(
message_t
&&
M
)
noexcept
{
ASSERT
(
bool
(
*
this
));
S
.
send
(
*
this
,
std
::
move
(
M
));
}
}
// End namespace rosa
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sun, Mar 1, 9:34 PM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
277149
Default Alt Text
AgentHandle.cpp (1 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline
Log In to Comment