Refactored the HIDDEN macro into its own header
All checks were successful
Test And Build / Lint (push) Successful in 5s
Test And Build / Build (push) Successful in 5s

This commit is contained in:
2025-08-12 09:07:32 +02:00
parent c19e4845e4
commit 7965dd3b2e
5 changed files with 40 additions and 29 deletions

View File

@@ -204,7 +204,7 @@ transferred to (motor_record_pv_name).MRES or to
## Developer guide
### Base classes
### File structure
sinqMotor offers a variety of additional methods for children classes to standardize certain patterns (e.g. writing messages to the IOC shell and the motor message PV). For a detailed description, please see the respective function documentation in the .h-files. All of these functions can be overwritten manually if e.g. a completely different implementation of `poll` is required. Some functions are marked as virtual, because they are called from other functions of sinqMotor and therefore need runtime polymorphism. Functions without that marker are not called anywhere in sinqMotor (except for `forcedPoll`, which is called in `poll`).
@@ -263,6 +263,20 @@ This method should not be called in the driver code itself if a poll is needed -
#### msgPrintControl.h
In addition to the two extension classes this library also includes a mechanism which prevents excessive repetitions of the same error message to the IOC shell via the classes `msgPrintControl` and `msgPrintControlKey`. A detailed description of the mechanism can be found in the docstring of `msgPrintControl`. The implementation of the `poll` function of `sinqAxis` also contains an example how to use it. Using this feature in derived drivers is entirely optional.
#### macros.h
Contains macros used in `sinqMotor` and derived drivers:
*HIDDEN*
By default, the symbols of classes and functions are hidden to avoid symbol clashes when loading
multiple shared libraries which use `sinqMotor`. In order to compile this library with exported
symbols, specifiy `-DHIDDEN= ` as a compiler flag (if using the given Makefile, this
needs to be added to the `USR_CFLAGS`).
Derived libraries can use the same mechanism via the macro `HIDDEN` (defined in `macros.h`):
```
class HIDDEN turboPmacController : public sinqController
```
### Versioning
The versioning is done via git tags. Git tags are recognized by the PSI build system: If you tag a version as 1.0, it will be built into the directory /ioc/modules/sinqMotor/1.0. The tag is directly coupled to a commit so that it is always clear which source code was used to build which binary.
@@ -310,15 +324,3 @@ If your driver uses another driver as a static dependency via git submodule whic
- `git submodule update --init --recursive`
This will update sinqMotor to the version specified in the 1.0 commit of turboPmac.
### Exporting symbols
By default, the symbols of classes and functions are hidden to avoid symbol clashes when loading
multiple shared libraries which use `sinqMotor`. In order to compile this library with exported
symbols, specifiy `-DHIDDEN= ` as a compiler flag (if using the given Makefile, this
needs to be added to the `USR_CFLAGS`).
Derived libraries can use the same mechanism via the macro `HIDDEN` (defined in `msgPrintControl.h`):
```
class HIDDEN turboPmacController : public sinqController
```