다음을 통해 공유


C++ Namespaces in the UPnP AV Framework (Windows Embedded CE 6.0)

1/6/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.

See Also

Other Resources

Using the UPnP AV Framework