libe3 0.2.5
C++ library for E3AP RAN vendor integration
Loading...
Searching...
No Matches
libe3::DAppSubscriptionState Class Reference

#include <dapp_subscription_state.hpp>

Public Member Functions

 DAppSubscriptionState ()=default
 DAppSubscriptionState (const DAppSubscriptionState &)=delete
DAppSubscriptionState & operator= (const DAppSubscriptionState &)=delete
void record_setup_response (uint32_t dapp_id, std::vector< RanFunctionDef > functions)
 Store the assignment from a SetupResponse. Called once after a positive SetupResponse arrives.
void record_subscription (uint32_t ran_function_id, uint32_t subscription_id)
 Record a successful SubscriptionResponse. Idempotent: re-recording the same (rf_id, sub_id) is fine.
bool remove_subscription_by_rf (uint32_t ran_function_id)
 Remove the subscription for a given RAN function.
bool remove_subscription_by_id (uint32_t subscription_id)
 Remove the subscription with a given subscription ID.
std::vector< uint32_t > active_subscriptions () const
 Snapshot of active subscription IDs.
std::vector< uint32_t > subscribed_ran_functions () const
 Snapshot of RAN function IDs this dApp is currently subscribed to.
std::optional< uint32_t > subscription_id_for (uint32_t ran_function_id) const
 Look up subscription ID for a RAN function.

Public Attributes

std::mutex mu
std::optional< uint32_t > assigned_dapp_id
 Assigned by the RAN in SetupResponse. nullopt until setup completes.
std::vector< RanFunctionDef > remote_ran_functions
 RAN functions advertised by the RAN in SetupResponse.
std::unordered_map< uint32_t, uint32_t > ran_function_to_subscription_id
 rf_id -> sub_id
std::unordered_map< uint32_t, uint32_t > subscription_id_to_ran_function
 sub_id -> rf_id (reverse, used for SubscriptionDelete)

Detailed Description

Definition at line 35 of file dapp_subscription_state.hpp.

Constructor & Destructor Documentation

◆ DAppSubscriptionState() [1/2]

libe3::DAppSubscriptionState::DAppSubscriptionState ( )
default

◆ DAppSubscriptionState() [2/2]

libe3::DAppSubscriptionState::DAppSubscriptionState ( const DAppSubscriptionState & )
delete

Member Function Documentation

◆ active_subscriptions()

std::vector< uint32_t > libe3::DAppSubscriptionState::active_subscriptions ( ) const
inline

Snapshot of active subscription IDs.

Definition at line 98 of file dapp_subscription_state.hpp.

◆ operator=()

DAppSubscriptionState & libe3::DAppSubscriptionState::operator= ( const DAppSubscriptionState & )
delete

◆ record_setup_response()

void libe3::DAppSubscriptionState::record_setup_response ( uint32_t dapp_id,
std::vector< RanFunctionDef > functions )
inline

Store the assignment from a SetupResponse. Called once after a positive SetupResponse arrives.

Definition at line 46 of file dapp_subscription_state.hpp.

◆ record_subscription()

void libe3::DAppSubscriptionState::record_subscription ( uint32_t ran_function_id,
uint32_t subscription_id )
inline

Record a successful SubscriptionResponse. Idempotent: re-recording the same (rf_id, sub_id) is fine.

Definition at line 57 of file dapp_subscription_state.hpp.

◆ remove_subscription_by_id()

bool libe3::DAppSubscriptionState::remove_subscription_by_id ( uint32_t subscription_id)
inline

Remove the subscription with a given subscription ID.

Returns
true if a subscription was removed; false if none existed.

Definition at line 83 of file dapp_subscription_state.hpp.

◆ remove_subscription_by_rf()

bool libe3::DAppSubscriptionState::remove_subscription_by_rf ( uint32_t ran_function_id)
inline

Remove the subscription for a given RAN function.

Returns
true if a subscription was removed; false if none existed.

Definition at line 67 of file dapp_subscription_state.hpp.

◆ subscribed_ran_functions()

std::vector< uint32_t > libe3::DAppSubscriptionState::subscribed_ran_functions ( ) const
inline

Snapshot of RAN function IDs this dApp is currently subscribed to.

Definition at line 112 of file dapp_subscription_state.hpp.

◆ subscription_id_for()

std::optional< uint32_t > libe3::DAppSubscriptionState::subscription_id_for ( uint32_t ran_function_id) const
inline

Look up subscription ID for a RAN function.

Definition at line 126 of file dapp_subscription_state.hpp.

Member Data Documentation

◆ assigned_dapp_id

std::optional<uint32_t> libe3::DAppSubscriptionState::assigned_dapp_id

Assigned by the RAN in SetupResponse. nullopt until setup completes.

Definition at line 143 of file dapp_subscription_state.hpp.

◆ mu

std::mutex libe3::DAppSubscriptionState::mu
mutable

Definition at line 140 of file dapp_subscription_state.hpp.

◆ ran_function_to_subscription_id

std::unordered_map<uint32_t, uint32_t> libe3::DAppSubscriptionState::ran_function_to_subscription_id

rf_id -> sub_id

Definition at line 149 of file dapp_subscription_state.hpp.

◆ remote_ran_functions

std::vector<RanFunctionDef> libe3::DAppSubscriptionState::remote_ran_functions

RAN functions advertised by the RAN in SetupResponse.

Definition at line 146 of file dapp_subscription_state.hpp.

◆ subscription_id_to_ran_function

std::unordered_map<uint32_t, uint32_t> libe3::DAppSubscriptionState::subscription_id_to_ran_function

sub_id -> rf_id (reverse, used for SubscriptionDelete)

Definition at line 151 of file dapp_subscription_state.hpp.


The documentation for this class was generated from the following file: