From dcba74ca385e6b119f259293b4d02cc1f8f4cd33 Mon Sep 17 00:00:00 2001 From: Hideaki Tai Date: Tue, 6 Feb 2024 00:21:02 +0900 Subject: [PATCH] feat: bump arxcontainer to v0.6.0 --- ArduinoOSC/OSCClient.h | 2 +- ArduinoOSC/OSCServer.h | 2 +- ArduinoOSC/OscMessage.h | 10 +++++----- ArduinoOSC/OscTypes.h | 26 +++++++++++++------------- ArduinoOSC/OscUdpMap.h | 4 ++-- examples/arduino/OscEther/OscEther.ino | 4 ++-- library.json | 4 ++-- library.properties | 4 ++-- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ArduinoOSC/OSCClient.h b/ArduinoOSC/OSCClient.h index 3fab228..56e1bff 100644 --- a/ArduinoOSC/OSCClient.h +++ b/ArduinoOSC/OSCClient.h @@ -273,7 +273,7 @@ namespace osc { private: ElementRef publish_impl(const String& ip, const uint16_t port, const String& addr, ElementRef ref) { Destination dest {ip, port, addr}; - dest_map.insert(make_pair(dest, ref)); + dest_map.insert(std::make_pair(dest, ref)); return ref; } }; diff --git a/ArduinoOSC/OSCServer.h b/ArduinoOSC/OSCServer.h index 3fab384..40ed044 100644 --- a/ArduinoOSC/OSCServer.h +++ b/ArduinoOSC/OSCServer.h @@ -253,7 +253,7 @@ namespace osc { Server& getServer(const uint16_t port) { if (server_map.find(port) == server_map.end()) - server_map.insert(make_pair(port, ServerRef(new Server(port)))); + server_map.insert(std::make_pair(port, ServerRef(new Server(port)))); return *(server_map[port].get()); } diff --git a/ArduinoOSC/OscMessage.h b/ArduinoOSC/OscMessage.h index 28d9ca5..29e8764 100644 --- a/ArduinoOSC/OscMessage.h +++ b/ArduinoOSC/OscMessage.h @@ -98,7 +98,7 @@ namespace osc { Message& pushBool(const bool b) { type_tags += (char)(b ? TYPE_TAG_TRUE : TYPE_TAG_FALSE); - arguments.push_back(make_pair(storage.size(), storage.size())); + arguments.push_back(std::make_pair(storage.size(), storage.size())); return *this; } Message& pushInt32(const int32_t i) { return pushPod(TYPE_TAG_INT32, i); } @@ -107,14 +107,14 @@ namespace osc { Message& pushDouble(const double d) { return pushPod(TYPE_TAG_DOUBLE, d); } Message& pushString(const String& s) { type_tags += (char)TYPE_TAG_STRING; - arguments.push_back(make_pair(storage.size(), s.length() + 1)); + arguments.push_back(std::make_pair(storage.size(), s.length() + 1)); strcpy(storage.getBytes(s.length() + 1), s.c_str()); return *this; } Message& pushBlob(const Blob& b) { return pushBlob(b.data(), b.size()); } Message& pushBlob(const void* ptr, const size_t num_bytes) { type_tags += (char)TYPE_TAG_BLOB; - arguments.push_back(make_pair(storage.size(), num_bytes + 4)); + arguments.push_back(std::make_pair(storage.size(), num_bytes + 4)); pod2bytes((int32_t)num_bytes, storage.getBytes(4)); if (num_bytes) memcpy(storage.getBytes(num_bytes), ptr, num_bytes); return *this; @@ -222,7 +222,7 @@ namespace osc { size_t iarg = 0; while (iarg < type_tags.length()) { size_t len = getArgSize(type_tags[iarg], arg); - arguments.push_back(make_pair((size_t)(arg - storage.begin()), len)); + arguments.push_back(std::make_pair((size_t)(arg - storage.begin()), len)); arg += ceil4(len); ++iarg; } @@ -308,7 +308,7 @@ namespace osc { template Message& pushPod(const int tag, const POD& v) { type_tags += (char)tag; - arguments.push_back(make_pair(storage.size(), sizeof(POD))); + arguments.push_back(std::make_pair(storage.size(), sizeof(POD))); pod2bytes(v, storage.getBytes(sizeof(POD))); return *this; } diff --git a/ArduinoOSC/OscTypes.h b/ArduinoOSC/OscTypes.h index 6ad812e..a4b1056 100644 --- a/ArduinoOSC/OscTypes.h +++ b/ArduinoOSC/OscTypes.h @@ -92,47 +92,47 @@ namespace osc { template using UdpRef = std::shared_ptr; template - using UdpMap = arx::map, ARDUINOOSC_MAX_SUBSCRIBE_PORTS>; + using UdpMap = arx::stdx::map, ARDUINOOSC_MAX_SUBSCRIBE_PORTS>; namespace message { - using ArgumentType = arx::pair; - using ArgumentQueue = arx::vector; + using ArgumentType = arx::stdx::pair; + using ArgumentQueue = arx::stdx::vector; class Message; - using MessageQueue = arx::vector; + using MessageQueue = arx::stdx::vector; } // namespace message #ifndef ARDUINOOSC_DISABLE_BUNDLE - using BundleData = arx::vector; + using BundleData = arx::stdx::vector; #endif - using Blob = arx::vector; + using Blob = arx::stdx::vector; namespace client { namespace element { class Base; using Ref = std::shared_ptr; - using TupleRef = arx::vector; + using TupleRef = arx::stdx::vector; } // namespace element class Destination; using ElementRef = element::Ref; using ElementTupleRef = element::TupleRef; - using DestinationMap = arx::map; + using DestinationMap = arx::stdx::map; } // namespace client namespace server { namespace element { class Base; using Ref = std::shared_ptr; - using TupleRef = arx::vector; - using dummy_vector_t = arx::vector; + using TupleRef = arx::stdx::vector; + using dummy_vector_t = arx::stdx::vector; } // namespace element using ElementRef = element::Ref; using ElementTupleRef = element::TupleRef; - using CallbackMap = arx::map; + using CallbackMap = arx::stdx::map; template class Server; template using ServerRef = std::shared_ptr>; template - using ServerMap = arx::map, ARDUINOOSC_MAX_SUBSCRIBE_PORTS>; + using ServerMap = arx::stdx::map, ARDUINOOSC_MAX_SUBSCRIBE_PORTS>; } // namespace server } // namespace osc @@ -171,7 +171,7 @@ namespace osc { struct Storage { Blob data; - // reserve() makes no sense on arx::vector because capacity is fixed + // reserve() makes no sense on arx::stdx::vector because capacity is fixed Storage() { data.reserve(200); } char* getBytes(const size_t sz) { diff --git a/ArduinoOSC/OscUdpMap.h b/ArduinoOSC/OscUdpMap.h index 721e8a9..39724ee 100644 --- a/ArduinoOSC/OscUdpMap.h +++ b/ArduinoOSC/OscUdpMap.h @@ -40,7 +40,7 @@ namespace osc { // use first port for PORT_DISCARD if some udp instances exist if (port == PORT_DISCARD) { if (udp_map.empty()) { - udp_map.insert(make_pair(port, UdpRef(new S()))); + udp_map.insert(std::make_pair(port, UdpRef(new S()))); udp_map[port]->begin(port); } return udp_map.begin()->second; @@ -53,7 +53,7 @@ namespace osc { udp_discard_ref->second->stop(); udp_map.erase(udp_discard_ref); } - udp_map.insert(make_pair(port, UdpRef(new S()))); + udp_map.insert(std::make_pair(port, UdpRef(new S()))); udp_map[port]->begin(port); } return udp_map[port]; diff --git a/examples/arduino/OscEther/OscEther.ino b/examples/arduino/OscEther/OscEther.ino index f97e7c8..6b37ccb 100644 --- a/examples/arduino/OscEther/OscEther.ino +++ b/examples/arduino/OscEther/OscEther.ino @@ -11,14 +11,14 @@ // Ethernet stuff uint8_t mac[] = {0xAB, 0xCD, 0xEF, 0x01, 0x23, 0x45}; -const IPAddress ip(192, 168, 1, 201); +const IPAddress ip(192, 168, 0, 201); // Ethernet with useful options // const IPAddress dns (192, 168, 1, 1); // const IPAddress gateway (192, 168, 1, 1); // const IPAddress subnet (255, 255, 255, 0); // for ArduinoOSC -const char* host = "192.168.1.200"; +const char* host = "192.168.0.200"; const int recv_port = 54321; const int bind_port = 54345; const int send_port = 55555; diff --git a/library.json b/library.json index a4e2c63..fad3763 100644 --- a/library.json +++ b/library.json @@ -11,13 +11,13 @@ "url": "https://github.com/hideakitai", "maintainer": true }, - "version": "0.4.0", + "version": "0.4.1", "license": "MIT", "frameworks": "arduino", "platforms": "*", "dependencies": { - "hideakitai/ArxContainer": "*", + "hideakitai/ArxContainer": ">=0.6.0", "hideakitai/ArxSmartPtr": "*", "hideakitai/ArxTypeTraits": "*", "hideakitai/DebugLog": "*" diff --git a/library.properties b/library.properties index a0c9df1..71635cc 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ArduinoOSC -version=0.4.0 +version=0.4.1 author=hideakitai maintainer=hideakitai sentence=OSC subscriber / publisher for Arduino @@ -7,4 +7,4 @@ paragraph=OSC subscriber / publisher for Arduino category=Communication url=https://github.com/hideakitai/ArduinoOSC architectures=* -depends=ArxContainer,ArxSmartPtr,ArxTypeTraits,DebugLog +depends=ArxContainer(>=0.6.0),ArxSmartPtr,ArxTypeTraits,DebugLog