Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F28206840
AgentHandle.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
AgentHandle.hpp
View Options
/*******************************************************************************
*
* File: AgentHandle.hpp
*
* Contents: Declaration of AgentHandle.
*
* Copyright 2017
*
* Author: David Juhasz (david.juhasz@tuwien.ac.at)
*
******************************************************************************/
#ifndef ROSA_CORE_AGENTHANDLE_HPP
#define ROSA_CORE_AGENTHANDLE_HPP
#include
"rosa/core/AbstractAgent.hpp"
namespace
rosa
{
// Wraps an actual Agent to decouple its public interface.
// NOTE: Such decoupling might be necessary when operating with remote
// Systems, sometime in the future.
class
AgentHandle
:
public
AbstractAgent
<
AgentHandle
>
{
// The wrapped Agent instance.
Agent
&
A
;
// The owning MessagingSystem of A.
MessagingSystem
&
S
;
public
:
// Ctor.
AgentHandle
(
Agent
&
A
);
// Dtor, nothing to take care of.
~
AgentHandle
(
void
)
=
default
;
// Gives a reference to the wrapped Agent.
Agent
&
agent
(
void
)
const
noexcept
;
// Tells if the AgentHandle is valid, referring to an existing Agent.
// NOTE: AgentHandlers belong to MessagingSystems. Working with an
// AgentHandler whose originating MessagingSystem has already been destroyed
// results in undefined behavior.
operator
bool
(
void
)
const
noexcept
override
;
// Tells if the given reference refers to this Agent.
bool
operator
==
(
const
AgentHandle
&
H
)
const
noexcept
override
;
// Returns a reference to this Agent.
AgentHandle
self
(
void
)
noexcept
override
;
// Sends the given Message to this Agent.
// PRE: bool(*this)
void
sendMessage
(
message_t
&&
M
)
noexcept
override
;
};
}
// End namespace rosa
#endif
// ROSA_CORE_AGENTHANDLE_HPP
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Fri, Nov 20, 11:57 PM (5 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
416430
Default Alt Text
AgentHandle.hpp (1 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline