#include#include int main(int argc, char* argv[]) { CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); PortableServer::POA_var poa = PortableServer::POA::_narrow(orb->resolve_initial_references("RootPOA")); // use poa for various purposes... return orb->run(); }
void some_function(PortableServer::POA_var poa) { // use the poa reference... } int main(int argc, char* argv[]) { CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); PortableServer::POA_var poa = PortableServer::POA::_narrow(orb->resolve_initial_references("RootPOA")); some_function(poa); return orb->run(); }This example shows how a POA_var reference can be passed as an argument to a function, allowing the function to access the POA. This can be useful for modularity and reuse of code. In summary, the CPP PortableServer POA_var class is provided by the CORBA library in the TAO C++ package. It is used for obtaining references to Portable Object Adapters (POAs) that are stored in the ORB, and can be used for various purposes such as creating and activating servant objects.