class NPRPCObject
Swift
class NPRPCObject
Swift representation of a remote C++ nprpc::Object All data is accessed through the C++ object via the bridge - no duplication
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:62
Constructors
required init(from decoder: Decoder) throws
Decodes a reference from its IOR string. Throws for a malformed one.
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:85
required init(handle: UnsafeMutableRawPointer)
Initialize with a C++ Object handle
handle- Opaque pointer to nprpc::Object (takes ownership of reference)
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:270
init()
Create an empty/null object (not connected to any C++ object) Used as a placeholder in struct default values
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:276
Properties
class var classId: String { get }
Class ID for this proxy type, used for type checking in narrow.
Generated subclasses override it with their interface's id.
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:65
var classId: String { get }
The class ID string identifying the interface type
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:114
var data: NPRPCObjectData { get }
Get ObjectId data for marshalling to remote calls
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:255
var endpoint: NPRPCEndpoint { get }
The currently selected endpoint for communication
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:134
var flags: UInt16 { get }
Object flags (persistence, etc.)
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:109
let handle: UnsafeMutableRawPointer
Opaque handle to C++ nprpc::Object
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:70
var objectId: UInt64 { get }
The unique object ID within its POA
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:99
var origin: [UInt8] { get }
The origin UUID of the process that created this object
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:124
var poaIdx: UInt16 { get }
The POA index where this object is activated
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:104
var timeout: UInt32 { get set }
Timeout in milliseconds for RPC calls
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:143
var urls: String { get }
Available endpoint URLs for this object
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:119
Methods
@discardableResult func addRef() -> UInt32
Increment reference count
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:152
func encode(to encoder: Encoder) throws
Encodes the reference as its IOR string (ObjectId.toString()).
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:79
static func fromObjectId(_ objectId: detail.ObjectId) -> NPRPCObject?
Create an NPRPCObject from ObjectId data
objectId- The ObjectId containing all reference data
Returns A new NPRPCObject, or nil if creation failed
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:307
static func fromString(_ str: String) -> NPRPCObject?
Create an NPRPCObject from a serialized string (NPRPC IOR format)
str- The serialized object reference string
Returns A new NPRPCObject, or nil if parsing failed
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:297
@discardableResult func release() -> UInt32
Decrement reference count (called automatically in deinit)
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:158
func requireFdPassing() throws
Throws unless calls to this object can carry file descriptors.
Generated proxies call it before sending a method with an fd.
nprpc_swift/Sources/NPRPC/UniqueFD.swift:101
@discardableResult func selectEndpoint() -> Bool
Select the best available endpoint for communication
Returns true if an endpoint was selected, false if none available
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:168
@discardableResult func selectEndpoint(_ endpoint: NPRPCEndpoint) -> Bool
Select endpoint with a preferred endpoint hint
endpoint- The preferred endpoint to try to select
Returns true if the endpoint was selected, false if not available
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:176
func sendAsync(buffer: FlatBuffer, timeout: UInt32) async throws
Send a request and wait for its reply, discarding the response body.
Throws RpcError for setup and transport failures.
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:206
func sendAsyncReceive(buffer: FlatBuffer, timeout: UInt32) async throws -> FlatBuffer
Send a request and receive its response buffer.
Throws RpcError for setup and transport failures. Generated proxies
decode remote IDL errors separately from the returned response.
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:213
@discardableResult func sendUnreliable(buffer: FlatBuffer) -> Bool
Fire-and-forget send for IDL [unreliable] methods.
Writes the request and returns. Unlike sendAsync / sendAsyncReceive,
this never waits for a reply and must not occupy the transport's
reply-wait queue — the server deliberately sends nothing back for
[unreliable] (e.g. LavaUI Present). Using a reply waiter there
times out after ~1s and, on shared memory, steals later real replies
that are matched by queue position.
buffer- Request buffer; storage is consumed (moved) like the other send paths.
Returns true if the transport accepted the write.
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:200
func toString() -> String
Serialize this object reference to a string (similar to CORBA IOR) Format: "NPRPC1:<base64_encoded_data>" This string can be shared and used to recreate the object reference elsewhere.
nprpc_swift/Sources/NPRPC/NPRPCObject.swift:286