AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
SensorOutputHandler.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16#pragma once
18
19namespace agxSensor
20{
25 {
26 public:
31
37 ISensorOutput* get( size_t uniqueId );
38
44 virtual ISensorOutput* getBase( size_t uniqueId ) = 0;
45
53 template<typename T>
54 BinaryOutputView<T> view( size_t uniqueId );
55
57
58 public:
59 virtual ~ISensorOutputHandler() = default;
60
62 };
63
64 template<typename T>
65 BinaryOutputView<T> ISensorOutputHandler::view( size_t uniqueId )
66 {
67 auto output = this->getBase( uniqueId );
68 if ( output == nullptr ) {
69 LOGGER_WARNING() << "Sensor output of unique id \"" << uniqueId << "\" hasn't been "
70 "registered. An empty view is returned." << LOGGER_ENDL();
71 return {};
72 }
73 return output->template view<T>();
74 }
75}
#define LOGGER_WARNING()
Definition: Logger.h:23
#define LOGGER_ENDL()
Definition: Logger.h:27
#define AGXSENSOR_EXPORT
View for reading sections of a binary packed buffer of the specified template parameter type.
Common interface for sensor output handlers.
virtual ISensorOutput * getBase(size_t uniqueId)=0
Access sensor output instance given the unique id from when it was added.
ISensorOutput * get(size_t uniqueId)
Access sensor output instance given the unique id from when it was added.
ISensorOutputHandler()=default
Default constructor.
Common interface for sensor output data.
Definition: SensorOutput.h:27
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
The agxSensor namespace contains components to model real-time sensors connected to the physics of AG...