Refactored CMakeLists.txt

* new pip_module() macro
 * fixed exports
 * automatic gather all exports and pass them to Doxygen and PICodeParser
This commit is contained in:
2020-08-01 21:29:32 +03:00
parent 21111b3e67
commit c7ac4fa551
79 changed files with 389 additions and 531 deletions

View File

@@ -56,7 +56,7 @@ public:
};
//! \brief Struct contains information about all records with same ID
struct BinLogRecordInfo {
struct PIP_EXPORT BinLogRecordInfo {
BinLogRecordInfo() {
id = count = 0;
minimum_size = maximum_size = 0;
@@ -70,7 +70,7 @@ public:
};
//! \brief Struct contains full information about Binary Log file and about all Records using map of \a BinLogRecordInfo
struct BinLogInfo {
struct PIP_EXPORT BinLogInfo {
PIString path;
int records_count;
llong log_size;
@@ -80,7 +80,7 @@ public:
};
//! \brief Struct contains position, ID and timestamp of record in file
struct BinLogIndex {
struct PIP_EXPORT BinLogIndex {
int id;
llong pos;
PISystemTime timestamp;
@@ -293,7 +293,7 @@ protected:
DeviceInfoFlags deviceInfoFlags() const {return PIIODevice::Reliable;}
private:
struct BinLogRecord {
struct PIP_EXPORT BinLogRecord {
int id;
int size;
PISystemTime timestamp;

View File

@@ -505,8 +505,8 @@ private:
#ifdef PIP_STD_IOSTREAM
std::ostream & operator <<(std::ostream & s, const PIConfig::Branch & v);
std::ostream & operator <<(std::ostream & s, const PIConfig::Entry & v);
PIP_EXPORT std::ostream & operator <<(std::ostream & s, const PIConfig::Branch & v);
PIP_EXPORT std::ostream & operator <<(std::ostream & s, const PIConfig::Entry & v);
#endif
inline PICout operator <<(PICout s, const PIConfig::Branch & v) {s.setControl(0, true); v.piCoutt(s, ""); s.restoreControl(); return s;}

View File

@@ -43,7 +43,7 @@ public:
explicit PIEthernet();
//! \brief Type of %PIEthernet
enum PIP_EXPORT Type {
enum Type {
UDP /** UDP - User Datagram Protocol */ ,
TCP_Client /** TCP client - allow connection to TCP server */ ,
TCP_Server /** TCP server - receive connections from TCP clients */ ,
@@ -51,7 +51,7 @@ public:
};
//! \brief Parameters of %PIEthernet
enum PIP_EXPORT Parameters {
enum Parameters {
ReuseAddress /** Rebind address if there is already binded. Enabled by default */ = 0x1,
Broadcast /** Broadcast send. Disabled by default */ = 0x2,
SeparateSockets /** If this parameter is set, %PIEthernet will initialize two different sockets,
@@ -63,7 +63,7 @@ public:
//! \brief IPv4 network address, IP and port
class Address {
class PIP_EXPORT Address {
friend class PIEthernet;
friend inline PIByteArray & operator <<(PIByteArray & s, const PIEthernet::Address & v);
friend inline PIByteArray & operator >>(PIByteArray & s, PIEthernet::Address & v);
@@ -322,7 +322,7 @@ public:
//! Flags of network interface
enum PIP_EXPORT InterfaceFlag {
enum InterfaceFlag {
ifActive /** Is active */ = 0x1,
ifRunning /** Is running */ = 0x2,
ifBroadcast /** Support broadcast */ = 0x4,
@@ -485,7 +485,7 @@ protected:
void applyTimeout(int fd, int opt, double ms);
void applyOptInt(int level, int opt, int val);
PRIVATE_DECLARATION
PRIVATE_DECLARATION(PIP_EXPORT)
int sock, sock_s;
bool connected_, connecting_, listen_threaded, server_bounded;
mutable Address addr_r, addr_s, addr_lr;

View File

@@ -38,7 +38,7 @@ public:
struct PIP_EXPORT FileInfo {
FileInfo() {size = 0; id_group = id_user = 0;}
enum PIP_EXPORT Flag {
enum Flag {
File = 0x01,
Dir = 0x02,
Dot = 0x04,
@@ -292,7 +292,7 @@ protected:
private:
PIString strType(const PIIODevice::DeviceMode type);
PRIVATE_DECLARATION
PRIVATE_DECLARATION(PIP_EXPORT)
int ret, prec_, fdi;
PIString prec_str;

View File

@@ -26,7 +26,7 @@
#include "pithread.h"
class PIGPIO: public PIThread
class PIP_EXPORT PIGPIO: public PIThread
{
PIOBJECT_SUBCLASS(PIGPIO, PIThread)
public:
@@ -85,7 +85,7 @@ public:
//! \}
private:
struct GPIOData {
struct PIP_EXPORT GPIOData {
GPIOData() {dir = PIGPIO::In; num = fd = -1;}
PIString name;
int dir;

View File

@@ -36,7 +36,7 @@ public:
explicit PIPeer(const PIString & name = PIString());
virtual ~PIPeer();
class PeerInfo {
class PIP_EXPORT PeerInfo {
friend class PIPeer;
friend PIByteArray & operator <<(PIByteArray & s, const PIPeer::PeerInfo & v);
friend PIByteArray & operator >>(PIByteArray & s, PIPeer::PeerInfo & v);
@@ -44,7 +44,7 @@ public:
PeerInfo() {dist = sync = cnt = 0; trace = -1; was_update = false; _data = 0;}
~PeerInfo() {}
struct PeerAddress {
struct PIP_EXPORT PeerAddress {
PeerAddress(const PIEthernet::Address & a = PIEthernet::Address(), const PIEthernet::Address & m = PIEthernet::Address("255.255.255.0"));
bool isAvailable() const {return ping > 0;}
PIEthernet::Address address;

View File

@@ -72,7 +72,7 @@ public:
};
//! \brief Information about serial device
struct DeviceInfo {
struct PIP_EXPORT DeviceInfo {
DeviceInfo();
//! \brief String representation of USB ID in format \"xxxx:xxxx\"
@@ -246,7 +246,7 @@ protected:
bool openDevice();
bool closeDevice();
PRIVATE_DECLARATION
PRIVATE_DECLARATION(PIP_EXPORT)
int fd, vtime;
bool sending;
PITimeMeasurer tm_;

View File

@@ -86,7 +86,7 @@ private:
void initPrivate();
int dsize;
PRIVATE_DECLARATION
PRIVATE_DECLARATION(PIP_EXPORT)
};

View File

@@ -77,7 +77,7 @@ private:
uchar spi_bits;
PIByteArray tx_buf, rx_buf;
PIByteArray recv_buf;
PRIVATE_DECLARATION
PRIVATE_DECLARATION(PIP_EXPORT)
};
#endif // PISPI_H

View File

@@ -34,7 +34,7 @@ public:
explicit PIUSB(ushort vid = 0, ushort pid = 0);
~PIUSB() {closeDevice();}
struct Endpoint {
struct PIP_EXPORT Endpoint {
Endpoint(uchar a = 0, uchar at = 0, ushort mps = 0) {address = a; attributes = at; max_packet_size = mps; parse();}
enum Direction {Write = 0, Read = 1};
@@ -54,7 +54,7 @@ public:
UsageType usage_type;
};
struct Interface {
struct PIP_EXPORT Interface {
Interface() {index = value_to_select = class_code = subclass_code = protocol_code = 0;}
uchar index;
uchar value_to_select;
@@ -64,7 +64,7 @@ public:
PIVector<PIUSB::Endpoint> endpoints;
};
struct Configuration {
struct PIP_EXPORT Configuration {
Configuration() {index = value_to_select = attributes = max_power = 0; self_powered = remote_wakeup = false;}
uchar index;
uchar value_to_select;
@@ -75,7 +75,7 @@ public:
PIVector<PIUSB::Interface> interfaces;
};
struct Descriptor {
struct PIP_EXPORT Descriptor {
Descriptor() {usb_spec_number = 0; device_class = device_subclass = device_protocol = max_packet_size = 0; id_vendor = id_product = id_device_release = 0; index_manufacturer = index_product = index_serial = 0;}
ushort usb_spec_number;
uchar device_class;
@@ -148,6 +148,6 @@ protected:
};
PICout operator <<(PICout s, const PIUSB::Endpoint & v);
PIP_EXPORT PICout operator <<(PICout s, const PIUSB::Endpoint & v);
#endif // PIUSB_H