Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1494131
DeluxeSensor.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Size
1 KB
Referenced Files
None
Subscribers
None
DeluxeSensor.cpp
View Options
//===-- deluxe/DeluxeSensor.cpp ---------------------------------*- C++ -*-===//
//
// The RoSA Framework
//
//===----------------------------------------------------------------------===//
///
/// \file deluxe/DeluxeSensor.cpp
///
/// \author David Juhasz (david.juhasz@tuwien.ac.at)
///
/// \date 2017-2019
///
/// \brief Implementation of rosa/deluxe/DeluxeSensor.hpp.
///
//===----------------------------------------------------------------------===//
#include
"rosa/deluxe/DeluxeSensor.hpp"
#include
"rosa/deluxe/DeluxeAgent.hpp"
namespace
rosa
{
namespace
deluxe
{
DeluxeSensor
::~
DeluxeSensor
(
void
)
noexcept
{
LOG_TRACE
(
"Destroying DeluxeSensor..."
);
// Make sure \p this object is not a registered *slave*.
if
(
Master
)
{
ASSERT
(
unwrapAgent
(
*
Master
).
Kind
==
atoms
::
AgentKind
);
// Sanity check.
DeluxeAgent
&
M
=
static_cast
<
DeluxeAgent
&>
(
unwrapAgent
(
*
Master
));
ASSERT
(
M
.
positionOfSlave
(
self
())
!=
M
.
NumberOfInputs
);
// Sanity check.
M
.
registerSlave
(
M
.
positionOfSlave
(
self
()),
{});
Master
=
{};
}
}
Optional
<
AgentHandle
>
DeluxeSensor
::
master
(
void
)
const
noexcept
{
return
Master
;
}
void
DeluxeSensor
::
registerMaster
(
const
Optional
<
AgentHandle
>
_Master
)
noexcept
{
ASSERT
(
!
_Master
||
unwrapAgent
(
*
_Master
).
Kind
==
atoms
::
AgentKind
);
Master
=
_Master
;
}
void
DeluxeSensor
::
clearSimulationDataSource
(
void
)
noexcept
{
SFP
=
nullptr
;
}
bool
DeluxeSensor
::
simulationDataSourceIsSet
(
void
)
const
noexcept
{
return
SFP
!=
nullptr
;
}
void
DeluxeSensor
::
handleTrigger
(
atoms
::
Trigger
)
noexcept
{
// Use \c rosa::deluxe::DeluxeSensor::SFP if set, otherwise
// \c rosa::deluxe::DeluxeSensor::FP.
const
H
&
F
=
SFP
?
SFP
:
FP
;
F
();
}
}
// End namespace deluxe
}
// End namespace rosa
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sun, Mar 1, 6:32 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
281354
Default Alt Text
DeluxeSensor.cpp (1 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline
Log In to Comment