mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
Optional: nonstd to std
This commit is contained in:
@@ -56,7 +56,7 @@ public:
|
||||
bool sendCommand(ExtendedCommand cmd, std::vector<uint8_t> arguments = {});
|
||||
bool getSettingsSync(std::vector<uint8_t>& data, std::chrono::milliseconds timeout = std::chrono::milliseconds(50));
|
||||
std::shared_ptr<SerialNumberMessage> getSerialNumberSync(std::chrono::milliseconds timeout = std::chrono::milliseconds(50));
|
||||
optional< std::vector< optional<DeviceAppVersion> > > getVersionsSync(std::chrono::milliseconds timeout = std::chrono::milliseconds(50));
|
||||
std::optional< std::vector< std::optional<DeviceAppVersion> > > getVersionsSync(std::chrono::milliseconds timeout = std::chrono::milliseconds(50));
|
||||
std::shared_ptr<LogicalDiskInfoMessage> getLogicalDiskInfoSync(std::chrono::milliseconds timeout = std::chrono::milliseconds(50));
|
||||
|
||||
int addMessageCallback(const MessageCallback& cb);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "icsneo/communication/message/main51message.h"
|
||||
#include "icsneo/communication/command.h"
|
||||
#include "icsneo/platform/optional.h"
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
namespace icsneo {
|
||||
@@ -29,8 +29,8 @@ public:
|
||||
bool cmTooBig;
|
||||
bool hidUsbState;
|
||||
bool fpgaUsbState;
|
||||
icsneo::optional<uint16_t> busVoltage;
|
||||
icsneo::optional<uint16_t> deviceTemperature;
|
||||
std::optional<uint16_t> busVoltage;
|
||||
std::optional<uint16_t> deviceTemperature;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "icsneo/communication/message/message.h"
|
||||
#include "icsneo/device/deviceversion.h"
|
||||
#include "icsneo/platform/optional.h"
|
||||
#include <optional>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
VersionMessage(Chip chip) : Message(Message::Type::DeviceVersion), ForChip(chip) {}
|
||||
|
||||
// nullopt here indicates invalid
|
||||
std::vector< optional<DeviceAppVersion> > Versions;
|
||||
std::vector< std::optional<DeviceAppVersion> > Versions;
|
||||
|
||||
// What chips the versions are for
|
||||
const Chip ForChip;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
#include "icsneo/communication/message/message.h"
|
||||
#include "icsneo/communication/command.h"
|
||||
#include "icsneo/platform/optional.h"
|
||||
#include "icsneo/communication/packet/wivicommandpacket.h"
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
namespace icsneo {
|
||||
@@ -24,9 +24,9 @@ class ResponseMessage : public Message {
|
||||
public:
|
||||
ResponseMessage() : Message(Message::Type::WiVICommandResponse) {}
|
||||
bool success = true;
|
||||
optional<Command> responseTo;
|
||||
optional<int32_t> value;
|
||||
optional<Info> info;
|
||||
std::optional<Command> responseTo;
|
||||
std::optional<int32_t> value;
|
||||
std::optional<Info> info;
|
||||
};
|
||||
|
||||
} // namespace WiVI
|
||||
|
||||
@@ -8,7 +8,7 @@ typedef uint8_t neonettype_t;
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <ostream>
|
||||
#include "icsneo/platform/optional.h"
|
||||
#include <optional>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
@@ -546,7 +546,7 @@ public:
|
||||
}
|
||||
return "Invalid Network";
|
||||
}
|
||||
static optional<CoreMini> GetCoreMiniNetworkFromNetID(NetID netid) {
|
||||
static std::optional<CoreMini> GetCoreMiniNetworkFromNetID(NetID netid) {
|
||||
switch(netid) {
|
||||
case NetID::HSCAN:
|
||||
return CoreMini::HSCAN;
|
||||
@@ -665,7 +665,7 @@ public:
|
||||
case NetID::Ethernet2:
|
||||
return CoreMini::Ethernet2;
|
||||
default:
|
||||
return nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
static NetID GetNetIDFromCoreMiniNetwork(CoreMini cm) {
|
||||
@@ -796,7 +796,7 @@ public:
|
||||
Network(CoreMini cm) { setValue(GetNetIDFromCoreMiniNetwork(cm)); }
|
||||
NetID getNetID() const { return value; }
|
||||
Type getType() const { return type; }
|
||||
optional<CoreMini> getCoreMini() const { return GetCoreMiniNetworkFromNetID(getNetID()); }
|
||||
std::optional<CoreMini> getCoreMini() const { return GetCoreMiniNetworkFromNetID(getNetID()); }
|
||||
friend std::ostream& operator<<(std::ostream& os, const Network& network) {
|
||||
os << GetNetIDString(network.getNetID());
|
||||
return os;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "icsneo/api/eventmanager.h"
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user