libe3 0.2.5
C++ library for E3AP RAN vendor integration
Loading...
Searching...
No Matches
libe3_swig.hpp
Go to the documentation of this file.
1/* SWIG-friendly re-declarations of the libe3 public API.
2 *
3 * SWIG 4.1 has trouble parsing some modern C++ constructs in the real
4 * headers (e.g. brace-initialised default arguments, std::function
5 * typedefs, std::variant). This file mirrors the slice of the API we
6 * want to expose to Python with SWIG-compatible declarations only.
7 *
8 * The actual implementations live in libe3 — this header exists purely
9 * so SWIG can parse simple declarations without needing C++-aware
10 * type recovery.
11 *
12 * SPDX-FileCopyrightText: Copyright (c) 2026 Northeastern University
13 * SPDX-License-Identifier: Apache-2.0
14 */
15
16#ifndef LIBE3_SWIG_HPP
17#define LIBE3_SWIG_HPP
18
19#include <cstdint>
20#include <string>
21#include <vector>
22#include <chrono>
23#include <memory>
24
25#include "libe3/types.hpp"
26
27namespace libe3 {
28
29// Forward-declared; real class lives in e3_agent.hpp. SWIG sees only
30// these signatures.
31class E3Agent {
32public:
35
38 void stop();
39 AgentState state() const noexcept;
40 bool is_running() const noexcept;
41
42 // Manual RAN-side operations (kept narrow — SM registration is not
43 // wrapped; the Python consumer keeps its own SM encoders).
45 uint32_t ran_function_id,
46 const std::vector<uint8_t>& data);
47 ErrorCode send_message_ack(uint32_t request_id, ResponseCode response_code);
48
49 // dApp-side verbs.
50 ErrorCode unsubscribe(uint32_t ran_function_id);
51 // sequence_id correlates a message with the procedure it belongs to:
52 // mandatory on a report, which starts one, and left 0 on a control the dApp
53 // decided on its own. out_message_id is not mirrored -- an out-pointer is
54 // not worth wrapping, and DAppSession returns the id directly.
55 ErrorCode send_control(uint32_t ran_function_id,
56 uint32_t control_id,
57 std::vector<uint8_t> action_data,
58 uint32_t sequence_id = 0);
59 ErrorCode send_report(uint32_t ran_function_id,
60 std::vector<uint8_t> report_data,
61 uint32_t sequence_id);
63 std::vector<uint32_t> subscribed_ran_functions() const;
64 std::vector<uint32_t> active_subscription_ids() const;
65
66 const E3Config& config() const noexcept;
67 size_t dapp_count() const;
68 size_t subscription_count() const;
69};
70
71} // namespace libe3
72
73#endif // LIBE3_SWIG_HPP
E3Agent - Main façade for RAN vendor integration.
Definition e3_agent.hpp:85
bool is_running() const noexcept
Check if agent is running.
Definition e3_agent.cpp:144
std::vector< uint32_t > subscribed_ran_functions() const
Definition e3_agent.cpp:395
std::optional< uint32_t > dapp_id() const noexcept
dApp identifier assigned by the RAN in SetupResponse.
Definition e3_agent.cpp:390
ErrorCode release()
Definition e3_agent.cpp:451
std::vector< uint32_t > active_subscription_ids() const
Definition e3_agent.cpp:400
ErrorCode unsubscribe(uint32_t ran_function_id)
Definition e3_agent.cpp:424
size_t dapp_count() const
Get number of registered dApps.
Definition e3_agent.cpp:329
const E3Config & config() const noexcept
Get current configuration.
Definition e3_agent.cpp:321
ErrorCode send_report(uint32_t ran_function_id, std::vector< uint8_t > report_data, uint32_t sequence_id, uint32_t *out_message_id=nullptr)
Send a dApp report to the RAN.
Definition e3_agent.cpp:441
ErrorCode send_indication(uint32_t dapp_id, uint32_t ran_function_id, const std::vector< uint8_t > &data)
Send an indication message to a specific dApp.
Definition e3_agent.cpp:197
ErrorCode send_control(uint32_t ran_function_id, uint32_t control_id, std::vector< uint8_t > action_data, uint32_t sequence_id=0, uint32_t *out_message_id=nullptr)
Send a dApp control action to the RAN.
Definition e3_agent.cpp:430
AgentState state() const noexcept
ErrorCode init()
E3Agent(E3Config config)
size_t subscription_count() const
Get total number of active subscriptions.
Definition e3_agent.cpp:341
ErrorCode start()
ErrorCode send_message_ack(uint32_t request_id, ResponseCode response_code)
Send a message acknowledgment (e.g. ack a control/request from dApp).
Definition e3_agent.cpp:249
ErrorCode
Error codes returned by libe3 operations Use shared error-code list (see libe3/error_codes....
Definition types.hpp:141
AgentState
Agent state machine states.
Definition types.hpp:126
ResponseCode
E3AP response codes.
Definition types.hpp:101
Configuration for E3Agent.
Definition types.hpp:390
E3AP Protocol Types - Vendor-neutral type definitions.