Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F28203630
DeluxeSensor.cpp
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
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
///
/// \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
);
this
->
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
Fri, Nov 20, 10:17 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
412761
Default Alt Text
DeluxeSensor.cpp (1 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline