Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1493819
MessagingSystemImpl.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Size
2 KB
Referenced Files
None
Subscribers
None
MessagingSystemImpl.hpp
View Options
/*******************************************************************************
*
* File: MessagingSystemImpl.hpp
*
* Contents: Declaration of a basic implementation of the MessagingSystem
* interface.
*
* Copyright 2017
*
* Author: David Juhasz (david.juhasz@tuwien.ac.at)
*
******************************************************************************/
#ifndef ROSA_LIB_CORE_MESSAGINGSYSTEMIMPL_HPP
// NOLINT
#define ROSA_LIB_CORE_MESSAGINGSYSTEMIMPL_HPP
#include
"SystemImpl.hpp"
#include
"rosa/core/MessagingSystem.hpp"
namespace
rosa
{
// Implements MessagingSystem by extending SystemImpl by adding a
// simple implementation of Message sending: directly invoking the Agent with
// the given Message.
// NOTE: Keep in mind that sending a Message with this implementation
// translates into a direct function call.
class
MessagingSystemImpl
:
public
MessagingSystem
,
public
SystemImpl
{
// Referring to SystemImpl as Base inside the class.
using
Base
=
SystemImpl
;
public
:
// Ctor.
MessagingSystemImpl
(
const
std
::
string
&
Name
)
noexcept
;
protected
:
// NOTE: Simply forwarding calls to implementations from Base for the System
// interface.
// FIXME: How could we use the inherited implementations in a simpler way?
inline
id_t
nextId
(
void
)
noexcept
override
{
return
Base
::
nextId
();
}
inline
bool
isSystemCleaned
(
void
)
const
noexcept
override
{
return
Base
::
isSystemCleaned
();
}
inline
void
markCleaned
(
void
)
noexcept
override
{
Base
::
markCleaned
();
}
inline
void
registerUnit
(
Unit
&
U
)
noexcept
override
{
Base
::
registerUnit
(
U
);
}
inline
void
destroyUnit
(
Unit
&
U
)
noexcept
override
{
Base
::
destroyUnit
(
U
);
}
inline
bool
isUnitRegistered
(
const
Unit
&
U
)
const
noexcept
override
{
return
Base
::
isUnitRegistered
(
U
);
}
public
:
inline
const
std
::
string
&
name
(
void
)
const
noexcept
override
{
return
Base
::
name
();
}
inline
size_t
numberOfConstructedUnits
(
void
)
const
noexcept
override
{
return
Base
::
numberOfConstructedUnits
();
}
inline
size_t
numberOfLiveUnits
(
void
)
const
noexcept
override
{
return
Base
::
numberOfLiveUnits
();
}
inline
bool
empty
(
void
)
const
noexcept
override
{
return
Base
::
empty
();
}
// Directly invokes the Agent with the Message.
// PRE: isUnitRegistered(H.agent())
void
send
(
const
AgentHandle
&
H
,
message_t
&&
M
)
noexcept
override
;
};
}
// End namespace rosa
#endif
// ROSA_LIB_CORE_MESSAGINGSYSTEMIMPL_HPP
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sun, Mar 1, 5:57 PM (22 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
287665
Default Alt Text
MessagingSystemImpl.hpp (2 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline
Log In to Comment