Skip to content

Commit

Permalink
refactor(ipc,platform): clean up + more types
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Jul 16, 2024
1 parent bae7c55 commit cef088f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ipc/bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ export * from '{{url}}'
};

core->networkStatus.addObserver(this->networkStatusObserver, [this](auto json) {
if (json.has("name")) this->emit(json["name"].str(), json.str());
if (json.has("name")) {
this->emit(json["name"].str(), json.str());
}
});

core->networkStatus.start();
Expand Down
5 changes: 5 additions & 0 deletions src/platform/types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
#include <array>
#include <atomic>
#include <filesystem>
#include <fstream>
#include <functional>
#include <future>
#include <map>
#include <mutex>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
Expand All @@ -29,6 +31,8 @@ namespace SSC {
using StringStream = std::stringstream;
using WString = std::wstring;
using WStringStream = std::wstringstream;
using InputFileStream = std::ifstream;
using OutputFileStream = std::ofstream;
using Mutex = std::recursive_mutex;
using Lock = std::lock_guard<Mutex>;
using Map = std::map<String, String>;
Expand All @@ -46,6 +50,7 @@ namespace SSC {
template <typename T> using SharedPointer = std::shared_ptr<T>;
template <typename T> using UniquePointer = std::unique_ptr<T>;
template <typename T> using Promise = std::promise<T>;
template <typename T> using InputStreamBufferIterator = std::istreambuf_iterator<T>;

using ExitCallback = Function<void(int code)>;
using MessageCallback = Function<void(const String)>;
Expand Down

0 comments on commit cef088f

Please sign in to comment.