QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Com::Unknown Struct Reference
[QCom]

#include <Q/com.h>

Inheritance diagram for Com::Unknown:

AudioData::AudioDataLocation AudioData::Codec AudioData::CodecInstance AudioData::Converter AudioData::Format AudioData::Manager AudioData::Sample Com::ClassFactory Input::Controller Input::Controller2 Input::ControllerManager Input::ControllerManager2 Input::Value Net2::Address Net2::DataStream Net2::MediaObject Net2::ReadListener Net2::ReadStream Net2::Server Net2::Socket Net2::TimeoutListener Net2::TimeoutManager Net2::URLHandler Net2::WriteListener Net2::WriteStream Net::Address Net::DataStream Net::Factory Net::FileStream Net::MediaObject Net::ReadListener Net::Server Net::Socket Net::StreamBase Net::TimeoutListener Net::TimeoutManager Net::URLHandler Net::WriteListener Q::AnimationActionEd Q::AnimationEventEd Q::AnimationEventListenerEd Q::AnimationFactory Q::AnimationFactory2 Q::AnimationMachine Q::AnimationMachineListenerEd Q::AnimationMode Q::AnimationReaderContextEd Q::AnimationReaderListenerEd Q::AnimationStateEd Q::AnimationWriterContextEd Q::Entity Q::EntityFactory Q::EntityInstance Q::EntityIterator Q::EntityManager Q::IndexMarkerEd Q::IndexMarkup Q::IndexMarkupHelperEd Q::IndexMarkupIteratorEd Q::IndexNodeEd Q::IndexSetEd Q::IntersectionManager Q::Message Q::MessageManager Q::MessagePeer Q::MessageResult Q::MessageType Q::PathCursor Q::PathIterator Q::PathTypeIterator Q::PlacementAssetListenerEd Q::PlacementFactoryEd Q::PlacementReaderListenerEd Q::PlacementWriterListenerEd Q::Property Q::PropertyFactory Q::PropertyIterator Q::RouteIterator Q::Rule Q::SchemaEd Q::SchemaEntityDefEd Q::SchemaFactory Q::SchemaFactoryEd Q::SchemaInstanceDefEd Q::SchemaPlacementEd Q::SchemaReaderListenerEd Q::SchemaTransformEd Q::SchemaWriterListenerEd Q::ScriptConsole Q::ScriptController Q::ScriptEd Q::ScriptExecutionEd Q::ScriptExecutionListener Q::ScriptExecutionListenerEd Q::ScriptExpressionEd Q::ScriptFunctionCallEd Q::ScriptManager Q::ScriptManager2 Q::ScriptPropertyHolder Q::ScriptReaderContextEd Q::ScriptReaderListenerEd Q::ScriptRepository Q::ScriptVariableEd Q::SequenceEd Q::TransitionEd Q::TransitionIteratorEd Q::Variant Q::VariantCollection Q::VariantMap Q::WaypointIterator List of all members.

Public Member Functions

virtual Utils::Result queryInterface (const UUID &iid, void **p)=0
virtual unsigned int addRef ()=0
virtual unsigned int release ()=0

Static Public Attributes

UUID IID

Detailed Description

The Unknown interface forms the core of the COM framework. It contains methods for implementing reference counting and for searching for interfaces. The Unknown interface is the top-level base class of all interfaces, which ensures that every interface begins with the methods from Unknown. This ensures that every interface can perform reference counting and every interface can be used to search for alternative interfaces supported by the component. For example, code that uses an Unknown interface to call a method in the interface MyInterface might look like this:

 #include <Q/utils.h>
 #include <Q/com.h>
 
 using namespace Com;
 using namespace Utils;
 
 struct MyInterface: public Unknown
 {
     static UUID IID; // 12345678-1234-5678-9012-345678012345
 
     Result myInterfaceMethod() = 0;
 };
 
 void
 someFunction(Unknown* unk)
 {
     unk->addRef();             // hold a reference
 
     MyInterface* myInt;
     Result r;
     r = unk->queryInterface(MyInterface::IID,
                             (void**) &myInt);
     if (succeeded(r)) {
         myInt->myInterfaceMethod();
         myInt->release();
     }
 
     unk->release();            // finished
 }


Member Function Documentation

virtual unsigned int Com::Unknown::addRef  )  [pure virtual]
 

Increase the reference count by one. For debugging purposes, the new reference count is returned. Applications should not rely on this.

Implemented in Com::ClassFactoryBase.

virtual Utils::Result Com::Unknown::queryInterface const UUID iid,
void **  p
[pure virtual]
 

Query the component for a supported interface. If the component supports the interface uniquely identifier by iid, *p is set to a pointer to that interface, the component's reference count is increased by one and the value Utils::Success is returned. If the component does not support the requested interface, *p is set to zero and Utils::NoInterface is returned.

Implemented in Com::ClassFactoryBase.

virtual unsigned int Com::Unknown::release  )  [pure virtual]
 

Decrease the component's reference count by one. When the last reference to a component is released, the component will be deleted. For debugging purposes, the new value of the reference count is returned.

Implemented in Com::ClassFactoryBase.


Member Data Documentation

UUID Com::Unknown::IID [static]
 

The Unknown interface has an interface identifier with value 00000000-0000-0000-c000-000000000046.

Reimplemented in AudioData::AudioDataLocation, AudioData::Format, AudioData::Sample, AudioData::Converter, AudioData::Manager, AudioData::CodecInstance, AudioData::Codec, Com::ClassFactory, Input::ControllerManager, Input::ControllerManager2, Input::Controller, Input::Controller2, Input::Value, Input::BinaryValue, Input::AnalogueValue, Input::JoystickValue, Net2::MediaObject, Net2::ReadListener, Net2::ReadStream, Net2::WriteListener, Net2::WriteStream, Net2::DataStream, Net2::Address, Net2::Socket, Net2::URLHandler, Net2::InternetHandler, Net2::CacheHandler, Net2::Server, Net2::TimeoutListener, Net2::TimeoutManager, Net::MediaObject, Net::ReadListener, Net::StreamBase, Net::ReadStream, Net::WriteListener, Net::WriteStream, Net::DataStream, Net::Address, Net::Socket, Net::FileStream, Net::URLHandler, Net::InternetHandler, Net::CacheHandler, Net::Server, Net::TimeoutListener, Net::TimeoutManager, Net::Factory, Q::Variant, Q::VariantCollection, Q::VariantMap, Q::MessageResult, Q::MessageType, Q::Message, Q::MessagePeer, Q::MessageManager, Q::EntityInstance, Q::EntityInstance2, Q::Entity, Q::EntityFactory, Q::EntityIterator, Q::EntityManager, Q::EntityManager2, Q::IntersectionManager, Q::AnimationMode, Q::AnimationMachine, Q::AnimationFactory, Q::AnimationFactory2, Q::IndexMarkup, Q::Puppet, Q::Puppet2, Q::Rule, Q::ScriptRepository, Q::ScriptDriver2, Q::ScriptExecutionListener, Q::ScriptManager, Q::ScriptController, Q::ScriptManager2, Q::ScriptPropertyHolder, Q::Property, Q::PropertyIterator, Q::PropertyFactory, Q::SchemaFactory, Q::ScriptDriver, Q::ScriptVariableEd, Q::ScriptEd, Q::ScriptExecutionListenerEd, Q::ScriptExecutionListenerEd2, Q::ScriptExecutionEd, Q::ScriptExecutionEd2, Q::ScriptFunctionCallEd, Q::ScriptReaderListenerEd, Q::RuleEd, Q::ScriptManagerEd, Q::ScriptManagerEd2, Q::ScriptReaderContextEd, Q::ScriptExpressionEd, Q::IndexMarkupIteratorEd, Q::IndexMarkupEd, Q::IndexSetEd, Q::IndexMarkerEd, Q::IndexNodeEd, Q::CompleteIndexNodeEd, Q::MarkupIndexNodeEd, Q::OperatorIndexNodeEd, Q::IndexMarkupHelperEd, Q::AnimationModeEd, Q::AnimationEventEd, Q::AnimationActionEd, Q::PlayActionEd, Q::TransitionActionEd, Q::EventActionEd, Q::ModeActionEd, Q::BranchActionEd, Q::BranchActionEd2, Q::MergeActionEd, Q::UserActionEd, Q::SequenceEd, Q::AnimationEventListenerEd, Q::TransitionEd, Q::TransitionIteratorEd, Q::AnimationStateEd, Q::AnimationMachineListenerEd, Q::AnimationTargetEd, Q::AnimationMachineEd, Q::AnimationReaderContextEd, Q::AnimationWriterContextEd, Q::AnimationReaderListenerEd, Q::AnimationFactoryEd, Q::SchemaPlacementEd, Q::SchemaTransformEd, Q::SchemaPlacementEd2, Q::SchemaPlacementGeomEd, Q::SchemaPlacementPuppetEd, Q::SchemaInstanceDefEd, Q::SchemaEntityDefEd, Q::SchemaEntityDefEd2, Q::SchemaEd, Q::SchemaEd2, Q::SchemaReaderListenerEd, Q::SchemaReaderListenerEd2, Q::SchemaWriterListenerEd, Q::SchemaFactoryEd, Q::SchemaFactoryEd2, Q::PlacementReaderListenerEd, Q::PlacementReaderListenerEd2, Q::PlacementWriterListenerEd, Q::PlacementWriterListenerEd2, Q::PlacementAssetListenerEd, Q::PlacementFactoryEd, Q::PlacementFactoryEd2, Q::ScriptConsole, Q::Waypoint, Q::WaypointIterator, Q::WaypointManager, Q::Route, Q::RouteIterator, Q::RouteManager, Q::Path, Q::PathCursor, Q::PathIterator, Q::PathTypeIterator, Q::PathManager, Q::LinearPath, and Q::CRSplinePath.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004