CosNaming_...ContextExt(3)

πŸ“¦
version 5.2.2 Β· 2 versions
, in fedora 43, fedora 44

πŸ’– CosNaming_NamingContextExt β€” the Erlang module, bestie πŸ’–

okay so this is CosNaming_NamingContextExt from the CosNaming_...ContextExt(3) manual, and it's genuinely one of those little modules that does one job and does it iconically. ✨


🌸 NAME 🌸

CosNaming_NamingContextExt β€” no cap, this interface is literally the operation hub for converting a Name sequence to a string and back again. πŸ¦‹ Both directions. She does both. πŸ’…


✨ DESCRIPTION ✨

okay so first thing's first: to get access to the record definitions for the structures, you use this:

-include_lib("orber/COSS/CosNaming/CosNaming.hrl").

periodt. that's the include. don't forget it, bestie, or you'll be out here fighting undefined records at 2am. 😭

Also β€” and this is the part people sleep on β€” this module also exports the functions described in:

  • CosNaming_NamingContext

so yeah, she's not just doing her own thing, she's carrying the whole NamingContext vibe too. main character energy fr fr. πŸ‘‘


πŸŽ€ EXPORTS πŸŽ€

to_string(NamingContext, Name) -> Return

Types:

NameContext = #objref
Name = [NameComponent]
Return = string() | {'EXCEPTION', NamingContext::InvalidName{}}

This one stringifies a Name sequence to a string. That's it, that's the job. Name in, string out. πŸ“


to_name(NamingContext, NameString) -> Return

Types:

NameContext = #objref
NameString = string()
Return = [NameComponent] | {'EXCEPTION', NamingContext::InvalidName{}}

and this one is the glow-up in reverse: it converts a stringified Name to a Name sequence. πŸ’«


to_url(NamingContext, AddressString, NameString) -> Return

Types:

NameContext = #objref
Address = NameString = string()
Return = URLString | {'EXCEPTION', NamingContext::InvalidName{}} | {'EXCEPTION', NamingContextExt::InvalidAddress{}}

So what this operation does is take a corbaloc string and a stringified Name sequence as input, and it hands you back a fully formed URL string. like, fully assembled. no assembly required, she came ready. πŸ’…

⚠️ heads up though β€” you can get NamingContext::InvalidName{} or NamingContextExt::InvalidAddress{} thrown back at you, so handle your exceptions, bestie, don't just yolo it. πŸ’€

resolve_str(NamingContext, NameString) -> Return

Types:

NameContext = #objref
NameString = string()
Return = #objref | {'EXCEPTION', NamingContext::InvalidName{}}
| {'EXCEPTION', NamingContext::NotFound{why, rest_of_name}} |
{'EXCEPTION', NamingContext::CannotProceed{cxt, rest_of_name}}

Last but never least: this operation takes a stringified Name sequence as input and returns the associated object, if any. 🫢

and like… the exception menu here is long, okay? you can catch NamingContext::InvalidName{}, or NamingContext::NotFound{why, rest_of_name}, or NamingContext::CannotProceed{cxt, rest_of_name}. three whole flavours of nope. 😭 so write your error handling, she's worth it.


πŸ’œ little sign-off πŸ’œ

That's the whole page, bestie β€” every flag, type, exception and function accounted for, nothing skipped, nothing invented. 🌈

This one's brought to you by Ericsson AB, running orber 5.2.2, and filed under CosNaming_...ContextExt(3). πŸŽ€ go forth and stringify responsibly. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from