XPCOM::IObject Interface Reference

XPCOM::IObject Interface Reference

The object is the top-level object, from which anything which needs to get passed between modules should inherit. More...

Inherited by cellml_api::CellMLBootstrap, cellml_api::CellMLDOMElement, cellml_api::CellMLElement, cellml_api::CellMLElementIterator, cellml_api::CellMLElementSet, cellml_api::DocumentLoadedListener, cellml_api::DOMURLLoader, cellml_api::ExtensionAttributeIterator, cellml_api::ExtensionAttributeSet, cellml_api::ExtensionElementList, cellml_api::ImportInstantiationListener, cellml_api::MathContainer, cellml_api::MathList, cellml_api::MathMLElementIterator, cellml_api::ModelLoadedListener, cellml_api::ModelLoader, cellml_api::RDFRepresentation, cellml_api::URI, cellml_api::UserData, cellml_context::CellMLContext, cellml_context::CellMLModule, cellml_context::CellMLModuleIterator, cellml_context::CellMLModuleManager, cellml_context::CellMLModuleMonitor, cellml_context::CellMLTypeAnnotationManager, cellml_context::ModelList, cellml_context::ModelListMonitor, cellml_context::ModelNode, cellml_context::ModelNodeIterator, cellml_context::ModelNodeMonitor, cellml_services::AnnotationSet, cellml_services::AnnotationToolService, cellml_services::BaseUnit, cellml_services::BaseUnitInstance, cellml_services::CanonicalUnitRepresentation, cellml_services::CeLEDSBootstrap, cellml_services::CeLEDSExporterBootstrap, cellml_services::CellMLCompiledModel, cellml_services::CellMLIntegrationRun, cellml_services::CellMLIntegrationService, cellml_services::CellMLValidityError, cellml_services::CellMLValidityErrorSet, cellml_services::CeVAS, cellml_services::CeVASBootstrap, cellml_services::CodeExporter, cellml_services::CodeGenerator, cellml_services::CodeGeneratorBootstrap, cellml_services::CodeInformation, cellml_services::ComputationTarget, cellml_services::ComputationTargetIterator, cellml_services::ConnectedVariableSet, cellml_services::CUSES, cellml_services::CUSESBootstrap, cellml_services::CustomCodeInformation, cellml_services::CustomGenerator, cellml_services::DegreeVariable, cellml_services::DegreeVariableIterator, cellml_services::DictionaryGenerator, cellml_services::IntegrationProgressObserver, cellml_services::LanguageDictionary, cellml_services::MaLaESBootstrap, cellml_services::MaLaESResult, cellml_services::MaLaESTransform, cellml_services::TeLICeMResult, cellml_services::TeLICeMService, cellml_services::VACSService, dom::DOMImplementation, dom::NamedNodeMap, dom::Node, dom::NodeList, events::DocumentEvent, events::Event, events::EventListener, events::EventTarget, mathml_dom::MathMLContainer, rdf_api::Bootstrap, rdf_api::Container, rdf_api::DataSource, rdf_api::Node, rdf_api::NodeIterator, rdf_api::Triple, rdf_api::TripleEnumerator, rdf_api::TripleSet, SProS::Base, SProS::BaseIterator, SProS::BaseSet, SProS::Bootstrap, SRuS::Bootstrap, SRuS::GeneratedData, SRuS::GeneratedDataMonitor, SRuS::GeneratedDataSet, SRuS::SEDMLProcessor, SRuS::TransformedModel, SRuS::TransformedModelSet, xpath::XPathEvaluator, xpath::XPathExpression, xpath::XPathNSResolver, and xpath::XPathResult.

Public Member Functions

void add_ref ()
 Called to indicate that some code is keeping an owning reference to the object.
oneway void release_ref ()
 Removes a reference to an object which was created by some other means (e.g.
IObject query_interface (in utf8string id)
 Returns an IObject of the same implementation, which supports a specific interface.

Public Attributes

readonly attribute string objid
 Fetches the ID of the object.

Detailed Description

The object is the top-level object, from which anything which needs to get passed between modules should inherit.

Definition at line 57 of file xpcom.idl.

Member Function Documentation

void XPCOM::IObject::add_ref ( )

Called to indicate that some code is keeping an owning reference to the object.

That code must call release_ref() later when it has finished with the object, or a memory leak may result. The object should be preserved in memory. Care should be taken to ensure that a cycle of objects waiting for each other to call release_ref is not created.

IObject XPCOM::IObject::query_interface ( in utf8string  id)

Returns an IObject of the same implementation, which supports a specific interface.

Parameters
idThe name of the interface, with each part of the scope separated by double colons. For example, "XPCOM::IObject".
Returns
A supporting IObject, or null if interface not supported. An implementation should support query_interface for all interfaces directly or indirectly (through inheritance) supported by that interface.
Note
This particular operation needs special treatment by bridges, because although the return type is XPCOM::IObject, the bridge is expected to look up the id and produce a bridge suitable for casting to the desired type. If the bridge cannot do this, because, for example, it doesn't know the interface, it should return null (since the bridges + implementation cannot support the desired interface).
oneway void XPCOM::IObject::release_ref ( )

Removes a reference to an object which was created by some other means (e.g.

by return from a function, out parameters, or add_ref). The object may destroy itself any time after no references remain.

Member Data Documentation

readonly attribute string XPCOM::IObject::objid

Fetches the ID of the object.

IDs should be generated in a way which makes the probability of a collision negligible. The recommended method is to use a random number generated seeded with a sufficient amount of data, and output data in this form %08X-%04X-%04X-%04X-%04X%08X (where %0nX represents a hex string of n digits padded to the left with zeros if needed). The id must never change once set.

Definition at line 102 of file xpcom.idl.