C++ Namespaces in the UPnP AV Framework
A version of this page is also available for
4/8/2010
To avoid name collisions, the elements of the UPnP AV Framework API are declared in C++ namespaces.
The majority of the classes and other elements exist in the av_upnp namespace. The exceptions to this rule are:
- Parser and object elements, which are declared in av_upnp::DIDL_Lite
- Many of the string constants, which are declared in individual namespaces of their own. For example, AVTransportState is declared in av_upnp::TransportState.
For specific information about the namespace of any particular API element, see the Requirements section of the API documentation for that element.
The UPnP AV Framework, in the av_upnp.h file, includes the following code to map the av_upnp namespace to the shorter string av.
#ifndef NO_UPNPAV_AV_ALIAS
namespace av = av_upnp;
#endif
Unless you define NO_UPNPAV_AV_ALIAS, your code can refer to items using the shorter av string, like this:
av::IEventSink
If your application already includes another namespace called av, define NO_UPNPAV_AV_ALIAS and use the full av_upnp string in your code.