Hide visibility of sinqController classes
This commit is contained in:
12
README.md
12
README.md
@@ -310,3 +310,15 @@ If your driver uses another driver as a static dependency via git submodule whic
|
|||||||
- `git submodule update --init --recursive`
|
- `git submodule update --init --recursive`
|
||||||
|
|
||||||
This will update sinqMotor to the version specified in the 1.0 commit of turboPmac.
|
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
|
||||||
|
```
|
||||||
|
|||||||
@@ -10,12 +10,27 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
/*
|
||||||
|
The macro "HIDDEN" hides the symbol of the annotated class / function. This is
|
||||||
|
useful to avoid symbol clashes when loading multiple shared libraries in a
|
||||||
|
single IOC. To override the hiding, add `-DHIDDEN= ` to your compiler
|
||||||
|
flags (in this case, the symbols will be exported with their default
|
||||||
|
visibility).
|
||||||
|
*/
|
||||||
|
#ifndef HIDDEN
|
||||||
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
|
#define HIDDEN
|
||||||
|
#else
|
||||||
|
#define HIDDEN __attribute__((visibility("hidden")))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Class to identify a message print location. See the docstring of
|
* @brief Class to identify a message print location. See the docstring of
|
||||||
* `msgPrintControl` on how to use this key.
|
* `msgPrintControl` on how to use this key.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class msgPrintControlKey {
|
class HIDDEN msgPrintControlKey {
|
||||||
public:
|
public:
|
||||||
std::string controller_;
|
std::string controller_;
|
||||||
|
|
||||||
@@ -82,7 +97,7 @@ template <> struct hash<msgPrintControlKey> {
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
class msgPrintControl {
|
class HIDDEN msgPrintControl {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Destroy the msgPrintControl object
|
* @brief Destroy the msgPrintControl object
|
||||||
|
|||||||
@@ -9,12 +9,13 @@ Stefan Mathis, November 2024
|
|||||||
#ifndef sinqAxis_H
|
#ifndef sinqAxis_H
|
||||||
#define sinqAxis_H
|
#define sinqAxis_H
|
||||||
#include "asynMotorAxis.h"
|
#include "asynMotorAxis.h"
|
||||||
|
#include "msgPrintControl.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
struct sinqAxisImpl;
|
struct sinqAxisImpl;
|
||||||
|
|
||||||
class epicsShareClass sinqAxis : public asynMotorAxis {
|
class HIDDEN sinqAxis : public asynMotorAxis {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Construct a new sinqAxis object
|
* @brief Construct a new sinqAxis object
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ Stefan Mathis, November 2024
|
|||||||
#define AbsoluteEncoder "absolute"
|
#define AbsoluteEncoder "absolute"
|
||||||
#define NoEncoder "none"
|
#define NoEncoder "none"
|
||||||
|
|
||||||
struct sinqControllerImpl;
|
struct HIDDEN sinqControllerImpl;
|
||||||
|
|
||||||
class epicsShareClass sinqController : public asynMotorController {
|
class HIDDEN sinqController : public asynMotorController {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Construct a new sinqController object
|
* @brief Construct a new sinqController object
|
||||||
|
|||||||
Reference in New Issue
Block a user