Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions aether/access_points/ethernet_access_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class EthernetAccessPoint : public AccessPoint {
ObjPtr<Server> const& server) override;

private:
Obj::ptr aether_;
Obj::ptr poller_;
Obj::ptr dns_resolver_;
ObjPtr<Aether> aether_;
ObjPtr<IPoller> poller_;
ObjPtr<DnsResolver> dns_resolver_;
};
} // namespace ae

Expand Down
4 changes: 2 additions & 2 deletions aether/access_points/lora_module_access_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
# include "aether/aether.h"
# include "aether/lora_modules/ilora_module_driver.h"

# include "aether/channels/lora_module_channel.h"
# include "aether/access_points/filter_endpoints.h"
# include "aether/channels/lora_module_channel.h"

namespace ae {
LoraModuleConnectAction::LoraModuleConnectAction(
Expand Down Expand Up @@ -80,7 +80,7 @@ ActionPtr<LoraModuleConnectAction> LoraModuleAccessPoint::Connect() {
// reuse connect action if it's in progress
if (!connect_action_) {
connect_action_ = ActionPtr<LoraModuleConnectAction>{
*aether_.as<Aether>(), lora_module_adapter_->lora_module_driver()};
*aether_, lora_module_adapter_->lora_module_driver()};
connect_sub_ = connect_action_->FinishedEvent().Subscribe(
[this]() { connect_action_.reset(); });
}
Expand Down
10 changes: 5 additions & 5 deletions aether/access_points/lora_module_access_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
#include "aether/config.h"

#if AE_SUPPORT_LORA
# include "aether/obj/obj.h"
# include "aether/access_points/access_point.h"
# include "aether/actions/action.h"
# include "aether/actions/action_ptr.h"
# include "aether/types/state_machine.h"
# include "aether/lora_modules/ilora_module_driver.h"
# include "aether/adapters/lora_module_adapter.h"
# include "aether/events/event_subscription.h"
# include "aether/access_points/access_point.h"
# include "aether/lora_modules/ilora_module_driver.h"
# include "aether/obj/obj.h"
# include "aether/types/state_machine.h"

namespace ae {
class Aether;
Expand Down Expand Up @@ -71,7 +71,7 @@ class LoraModuleAccessPoint final : public AccessPoint {
std::vector<Endpoint> const& endpoints) override;

private:
Obj::ptr aether_;
ObjPtr<Aether> aether_;
LoraModuleAdapter::ptr lora_module_adapter_;
ActionPtr<LoraModuleConnectAction> connect_action_;
Subscription connect_sub_;
Expand Down
3 changes: 1 addition & 2 deletions aether/access_points/modem_access_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ ModemConnectAction& ModemAccessPoint::Connect() {

// reuse connect action if it's in progress
if (!connect_action_ || connect_action_->is_finished()) {
connect_action_.emplace(*aether_.Load().as<Aether>(),
modem_adapter_->modem_driver());
connect_action_.emplace(*aether_, modem_adapter_->modem_driver());
}
return *connect_action_;
}
Expand Down
10 changes: 5 additions & 5 deletions aether/access_points/modem_access_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#include "aether/config.h"
#if AE_SUPPORT_MODEMS

# include "aether/obj/obj.h"
# include "aether/ae_context.h"
# include "aether/events/events.h"
# include "aether/access_points/access_point.h"
# include "aether/actions/action.h"
# include "aether/adapters/modem_adapter.h"
# include "aether/ae_context.h"
# include "aether/events/event_subscription.h"
# include "aether/access_points/access_point.h"
# include "aether/events/events.h"
# include "aether/obj/obj.h"

namespace ae {
class Aether;
Expand Down Expand Up @@ -66,7 +66,7 @@ class ModemAccessPoint final : public AccessPoint {
ObjPtr<Server> const& server) override;

private:
Obj::ptr aether_;
ObjPtr<Aether> aether_;
ModemAdapter::ptr modem_adapter_;
std::optional<ModemConnectAction> connect_action_;
Subscription connect_sub_;
Expand Down
4 changes: 2 additions & 2 deletions aether/access_points/wifi_access_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ WifiConnectAction& WifiAccessPoint::Connect() {
[](auto const& a) { return &a->driver(); });
assert(driver.has_value());

connect_action_.emplace(*aether_.Load().as<Aether>(), *this, **driver,
wifi_ap_, psp_, base_station_);
connect_action_.emplace(*aether_, *this, **driver, wifi_ap_, psp_,
base_station_);
}
return *connect_action_;
}
Expand Down
8 changes: 4 additions & 4 deletions aether/access_points/wifi_access_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
#include "aether/config.h"

#if AE_SUPPORT_WIFIS
# include "aether/actions/action.h"
# include "aether/ae_context.h"
# include "aether/obj/obj_ptr.h"
# include "aether/events/events.h"
# include "aether/actions/action.h"
# include "aether/obj/obj_ptr.h"

# include "aether/wifi/wifi_driver.h"
# include "aether/access_points/access_point.h"
# include "aether/wifi/wifi_driver.h"

namespace ae {
class Aether;
Expand Down Expand Up @@ -91,7 +91,7 @@ class WifiAccessPoint final : public AccessPoint {

private:
ObjPtr<Aether> aether_;
Obj::ptr adapter_;
ObjPtr<WifiAdapter> adapter_;
ObjPtr<IPoller> poller_;
ObjPtr<DnsResolver> resolver_;
WiFiAp wifi_ap_{};
Expand Down
4 changes: 2 additions & 2 deletions aether/adapters/lora_module_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include "aether/adapters/lora_module_adapter.h"
#if AE_SUPPORT_LORA

# include "aether/access_points/lora_module_access_point.h"
# include "aether/aether.h"
# include "aether/lora_modules/lora_module_factory.h"
# include "aether/access_points/lora_module_access_point.h"

# include "aether/adapters/adapter_tele.h"

Expand Down Expand Up @@ -56,7 +56,7 @@ std::vector<AccessPoint::ptr> LoraModuleAdapter::access_points() {
ILoraModuleDriver& LoraModuleAdapter::lora_module_driver() {
if (!lora_module_driver_) {
lora_module_driver_ = LoraModuleDriverFactory::CreateLoraModule(
*aether_.as<Aether>(), poller_, lora_module_init_);
*aether_, poller_, lora_module_init_);
}
return *lora_module_driver_;
}
Expand Down
8 changes: 4 additions & 4 deletions aether/adapters/modem_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#include "aether/adapters/modem_adapter.h"
#if AE_SUPPORT_MODEMS

# include "aether/access_points/modem_access_point.h"
# include "aether/aether.h"
# include "aether/poller/poller.h"
# include "aether/modems/imodem_driver.h"
# include "aether/modems/modem_factory.h"
# include "aether/access_points/modem_access_point.h"
# include "aether/poller/poller.h"

# include "aether/adapters/adapter_tele.h"

Expand Down Expand Up @@ -58,8 +58,8 @@ std::vector<AccessPoint::ptr> ModemAdapter::access_points() {

IModemDriver& ModemAdapter::modem_driver() {
if (!modem_driver_) {
modem_driver_ = ModemDriverFactory::CreateModem(
*aether_.Load().as<Aether>(), poller_, modem_init_);
modem_driver_ =
ModemDriverFactory::CreateModem(*aether_, poller_, modem_init_);
}
return *modem_driver_;
}
Expand Down
4 changes: 2 additions & 2 deletions aether/adapters/parent_lora_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include "aether/config.h"

#if AE_SUPPORT_LORA
# include "aether/aether.h"
# include "aether/adapters/adapter.h"
# include "aether/aether.h"
# include "aether/lora_modules/lora_module_driver_types.h"

namespace ae {
Expand All @@ -41,7 +41,7 @@ class ParentLoraModuleAdapter : public Adapter {

AE_OBJECT_REFLECT(AE_MMBRS(aether_, poller_, lora_module_init_))

Obj::ptr aether_;
ObjPtr<Aether> aether_;
IPoller::ptr poller_;

LoraModuleInit lora_module_init_;
Expand Down
4 changes: 2 additions & 2 deletions aether/adapters/parent_modem.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class ParentModemAdapter : public Adapter {

AE_OBJECT_REFLECT(AE_MMBRS(aether_, poller_, modem_init_))

Obj::ptr aether_;
Obj::ptr poller_;
ObjPtr<Aether> aether_;
ObjPtr<IPoller> poller_;

ModemInit modem_init_{};
};
Expand Down
9 changes: 5 additions & 4 deletions aether/ae_actions/select_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
#ifndef AETHER_AE_ACTIONS_SELECT_CLIENT_H_
#define AETHER_AE_ACTIONS_SELECT_CLIENT_H_

#include "aether/config.h"
#include "aether/ae_context.h"
#include "aether/obj/obj_ptr.h"
#include "aether-miscpp/types/result.h"
#include "aether/events/events.h"

#include "aether/actions/action.h"
#include "aether/ae_context.h"
#include "aether/config.h"
#include "aether/events/event_subscription.h"
#include "aether/events/events.h"
#include "aether/obj/obj_ptr.h"

namespace ae {
class Aether;
Expand Down
18 changes: 9 additions & 9 deletions aether/aether.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ class Aether : public Obj {
void StoreServer(ObjPtr<Server> s);
ObjPtr<Server> GetServer(ServerId server_id);

Obj::ptr client_prefab;
Obj::ptr registration_cloud;
ObjPtr<Client> client_prefab;
ObjPtr<RegistrationCloud> registration_cloud;

Obj::ptr crypto;
Obj::ptr poller;
Obj::ptr dns_resolver;
ObjPtr<Crypto> crypto;
ObjPtr<IPoller> poller;
ObjPtr<DnsResolver> dns_resolver;

Obj::ptr adapter_registry;
ObjPtr<AdapterRegistry> adapter_registry;

Obj::ptr tele_statistics;
ObjPtr<TeleStatistics> tele_statistics;

std::unique_ptr<TaskScheduler> task_scheduler;

Expand All @@ -113,8 +113,8 @@ class Aether : public Obj {
std::map<std::string, std::unique_ptr<Registration>> registrations_;
#endif

std::map<std::string, Obj::ptr> clients_;
std::map<ServerId, Obj::ptr> servers_;
std::map<std::string, ObjPtr<Client>> clients_;
std::map<ServerId, ObjPtr<Server>> servers_;

std::map<std::string, std::unique_ptr<SelectClientAction>>
select_client_actions_;
Expand Down
1 change: 0 additions & 1 deletion aether/channels/channels_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#ifndef AETHER_CHANNELS_CHANNELS_TYPES_H_
#define AETHER_CHANNELS_CHANNELS_TYPES_H_

#include <cstddef>
#include <cstdint>

#include "aether-miscpp/reflect/reflect.h"
Expand Down
11 changes: 5 additions & 6 deletions aether/channels/ethernet_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ namespace ethernet_access_point_internal {
using ResolveSender =
ex::AnySender<ex::set_value_t(std::vector<Endpoint>), ex::set_error_t(int)>;

ResolveSender ResolveAddress(
[[maybe_unused]] Ptr<DnsResolver> const& resolver,
[[maybe_unused]] NamedAddr const& addr,
[[maybe_unused]] std::uint16_t port,
[[maybe_unused]] Protocol protocol) {
ResolveSender ResolveAddress([[maybe_unused]] Ptr<DnsResolver> const& resolver,
[[maybe_unused]] NamedAddr const& addr,
[[maybe_unused]] std::uint16_t port,
[[maybe_unused]] Protocol protocol) {
#if AE_SUPPORT_CLOUD_DNS
return resolver->Resolve(addr, port, protocol);
#else
Expand Down Expand Up @@ -172,7 +171,7 @@ TransportBuildSender EthernetChannel::TransportBuilder() {
AE_TELED_DEBUG("Make transport builder for {}", address);

return ethernet_access_point_internal::MakeTransportBuilder(
AeContext{*aether_.Load().as<Aether>()}, resolver, poller, address);
AeContext{*aether_}, resolver, poller, address);
}

} // namespace ae
3 changes: 1 addition & 2 deletions aether/channels/ethernet_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
#ifndef AETHER_CHANNELS_ETHERNET_CHANNEL_H_
#define AETHER_CHANNELS_ETHERNET_CHANNEL_H_

#include "aether/memory.h"
#include "aether/types/address.h"
#include "aether/channels/channel.h"
#include "aether/types/address.h"

namespace ae {
class Aether;
Expand Down
6 changes: 3 additions & 3 deletions aether/channels/lora_module_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

# include <utility>

# include "aether/memory.h"
# include "aether/aether.h"
# include "aether/types/state_machine.h"
# include "aether/memory.h"
# include "aether/transport/lora_modules/lora_module_transport.h"
# include "aether/types/state_machine.h"

namespace ae {
namespace lora_module_channel_internal {
Expand Down Expand Up @@ -169,7 +169,7 @@ ActionPtr<TransportBuilderAction> LoraModuleChannel::TransportBuilder() {
}
return ActionPtr<
lora_module_channel_internal::LoraModuleTransportBuilderAction>{
*aether_.as<Aether>(), *this, *access_point_, address};
*aether_, *this, *access_point_, address};
}

Duration LoraModuleChannel::TransportBuildTimeout() const {
Expand Down
4 changes: 2 additions & 2 deletions aether/channels/lora_module_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include "aether/config.h"

#if AE_SUPPORT_LORA
# include "aether/channels/channel.h"
# include "aether/access_points/lora_module_access_point.h"
# include "aether/channels/channel.h"

namespace ae {
class Aether;
Expand All @@ -42,7 +42,7 @@ class LoraModuleChannel final : public Channel {
Duration TransportBuildTimeout() const override;

private:
Obj::ptr aether_;
ObjPtr<Aether> aether_;
LoraModuleAccessPoint::ptr access_point_;
};
} // namespace ae
Expand Down
8 changes: 4 additions & 4 deletions aether/channels/modem_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

# include <utility>

# include "aether/config.h"
# include "aether/memory.h"
# include "aether/aether.h"
# include "aether/config.h"
# include "aether/executors/executors.h"
# include "aether/memory.h"
# include "aether/transport/modems/modem_transport.h"

namespace ae {
Expand Down Expand Up @@ -112,8 +112,8 @@ ModemChannel::ModemChannel(ObjProp prop, ObjPtr<Aether> aether,
TransportBuildSender ModemChannel::TransportBuilder() {
auto ap = access_point_.Load();
assert(ap && "Access point is not loaded");
return modem_channel_internal::MakeTransportBuilderSender(
*aether_.Load().as<Aether>(), *ap, address);
return modem_channel_internal::MakeTransportBuilderSender(*aether_, *ap,
address);
}

Duration ModemChannel::TransportBuildTimeout() const {
Expand Down
6 changes: 3 additions & 3 deletions aether/channels/modem_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#include "aether/config.h"
#if AE_SUPPORT_MODEMS

# include "aether/types/address.h"
# include "aether/channels/channel.h"
# include "aether/access_points/modem_access_point.h"
# include "aether/channels/channel.h"
# include "aether/types/address.h"

namespace ae {
class Aether;
Expand All @@ -44,7 +44,7 @@ class ModemChannel final : public Channel {
Endpoint address;

private:
Obj::ptr aether_;
ObjPtr<Aether> aether_;
ModemAccessPoint::ptr access_point_;
};
} // namespace ae
Expand Down
Loading
Loading