class IORegistryEntry : public OSObject
{
- friend IORegistryIterator;
+ friend class IORegistryIterator;
OSDeclareDefaultStructors(IORegistryEntry)
OSDictionary * fRegistryTable;
OSDictionary * fPropertyTable;
+public:
+ /* methods available in Mac OS X 10.1 or later */
+
+/*! @function copyProperty
+ @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later.
+ @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s).
+ @param aKey The property's name as a C-string.
+ @param plane The plane to iterate over, eg. gIOServicePlane.
+ @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children.
+ @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */
+
+ virtual OSObject * copyProperty( const char * aKey,
+ const IORegistryPlane * plane,
+ IOOptionBits options =
+ kIORegistryIterateRecursively |
+ kIORegistryIterateParents) const;
+ OSMetaClassDeclareReservedUsed(IORegistryEntry, 0);
+
+/*! @function copyProperty
+ @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later.
+ @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s).
+ @param aKey The property's name as an OSString.
+ @param plane The plane to iterate over, eg. gIOServicePlane.
+ @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children.
+ @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */
+
+ virtual OSObject * copyProperty( const OSString * aKey,
+ const IORegistryPlane * plane,
+ IOOptionBits options =
+ kIORegistryIterateRecursively |
+ kIORegistryIterateParents) const;
+ OSMetaClassDeclareReservedUsed(IORegistryEntry, 1);
+
+/*! @function copyProperty
+ @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later.
+ @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s).
+ @param aKey The property's name as an OSSymbol.
+ @param plane The plane to iterate over, eg. gIOServicePlane.
+ @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children.
+ @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */
+
+ virtual OSObject * copyProperty( const OSSymbol * aKey,
+ const IORegistryPlane * plane,
+ IOOptionBits options =
+ kIORegistryIterateRecursively |
+ kIORegistryIterateParents) const;
+ OSMetaClassDeclareReservedUsed(IORegistryEntry, 2);
+
+/*! @function copyParentEntry
+ @abstract Returns an registry entry's first parent entry in a plane. Available in Mac OS X 10.1 or later.
+ @discussion This function will return the parent to which a registry entry was first attached. Since the majority of registry entrys have only one provider, this is a useful simplification.
+ @param plane The plane object.
+ @result Returns the first parent of the registry entry, or zero if the entry is not attached into the registry in that plane. A reference on the entry is returned to caller, which should be released. */
+
+ virtual IORegistryEntry * copyParentEntry( const IORegistryPlane * plane ) const;
+ OSMetaClassDeclareReservedUsed(IORegistryEntry, 3);
+
+/*! @function copyChildEntry
+ @abstract Returns an registry entry's first child entry in a plane. Available in Mac OS X 10.1 or later.
+ @discussion This function will return the child which first attached to a registry entry.
+ @param plane The plane object.
+ @result Returns the first child of the registry entry, or zero if the entry is not attached into the registry in that plane. A reference on the entry is returned to caller, which should be released. */
+
+ virtual IORegistryEntry * copyChildEntry( const IORegistryPlane * plane ) const;
+ OSMetaClassDeclareReservedUsed(IORegistryEntry, 4);
+
+ /* method available in Mac OS X 10.4 or later */
+/*!
+ @typedef Action
+ @discussion Type and arguments of callout C function that is used when
+a runCommand is executed by a client. Cast to this type when you want a C++
+member function to be used. Note the arg1 - arg3 parameters are passed straight pass through to the action callout.
+ @param target
+ Target of the function, can be used as a refcon. Note if a C++ function
+was specified, this parameter is implicitly the first parameter in the target
+member function's parameter list.
+ @param arg0 Argument to action from run operation.
+ @param arg1 Argument to action from run operation.
+ @param arg2 Argument to action from run operation.
+ @param arg3 Argument to action from run operation.
+*/
+ typedef IOReturn (*Action)(OSObject *target,
+ void *arg0, void *arg1,
+ void *arg2, void *arg3);
+
+/*! @function runPropertyAction
+ @abstract Single thread a call to an action w.r.t. the property lock
+ @discussion Client function that causes the given action to be called in a manner that syncrhonises with the registry iterators and serialisers. This functin can be used to synchronously manipulate the property table of this nub
+ @param action Pointer to function to be executed in work-loop context.
+ @param arg0 Parameter for action parameter, defaults to 0.
+ @param arg1 Parameter for action parameter, defaults to 0.
+ @param arg2 Parameter for action parameter, defaults to 0.
+ @param arg3 Parameter for action parameter, defaults to 0.
+ @result Returns the value of the Action callout.
+*/
+ virtual IOReturn runPropertyAction(Action action, OSObject *target,
+ void *arg0 = 0, void *arg1 = 0,
+ void *arg2 = 0, void *arg3 = 0);
+ OSMetaClassDeclareReservedUsed(IORegistryEntry, 5);
+
private:
- OSMetaClassDeclareReservedUnused(IORegistryEntry, 0);
- OSMetaClassDeclareReservedUnused(IORegistryEntry, 1);
- OSMetaClassDeclareReservedUnused(IORegistryEntry, 2);
- OSMetaClassDeclareReservedUnused(IORegistryEntry, 3);
- OSMetaClassDeclareReservedUnused(IORegistryEntry, 4);
- OSMetaClassDeclareReservedUnused(IORegistryEntry, 5);
+
OSMetaClassDeclareReservedUnused(IORegistryEntry, 6);
OSMetaClassDeclareReservedUnused(IORegistryEntry, 7);
OSMetaClassDeclareReservedUnused(IORegistryEntry, 8);
@discussion This method will return a pointer to the live property table as an OSDictionery. Its use is not recommended in most cases, instead use the synchronized accessors and helper functions of IORegistryEntry to access properties. It can only safely be used by one thread, which usually means it can only be used before a registry entry is entered into the registry.
@result A pointer to the property table as an OSDictionary. The pointer is valid while the registry entry is retained, and should not be released by the caller. */
- inline OSDictionary * getPropertyTable( void ) const
- { return(fPropertyTable); }
+ /* inline */ OSDictionary * getPropertyTable( void ) const;
+ /* { return(fPropertyTable); } */
/* Set properties from user level, to be overridden if supported */
@param plane The plane object.
@result Returns the first parent of the registry entry, or zero if the entry is not attached into the registry in that plane. The parent is retained while the entry is attached, and should not be released by the caller. */
- virtual IORegistryEntry * getParentEntry( const IORegistryPlane * plane )
- const;
+ virtual IORegistryEntry * getParentEntry( const IORegistryPlane * plane ) const;
/*! @function getChildIterator
@abstract Returns an iterator over an registry entry's child entries in a plane.
@param plane The plane object.
@result Returns the first child of the registry entry, or zero if the entry is not attached into the registry in that plane. The child is retained while the entry is attached, and should not be released by the caller. */
- virtual IORegistryEntry * getChildEntry( const IORegistryPlane * plane )
- const;
+ virtual IORegistryEntry * getChildEntry( const IORegistryPlane * plane ) const;
/*! @function isChild
@abstract Determines whether a registry entry is the child of another in a plane.
/*! @function inPlane
@abstract Determines whether a registry entry is attached in a plane.
- @discussion This method determines if the entry is attached in a plane to any other entry.
- @param plane The plane object.
- @result If the entry has a parent in the plane, true is returned, otherwise false is returned. */
+ @discussion This method determines if the entry is attached in a plane to any other entry. It can also be used to determine if the entry is a member of any plane.
+ @param plane The plane object, 0 indicates any plane.
+ @result If the entry has a parent in the given plane or if plane = 0 then if entry has any parent; return true, otherwise false. */
- virtual bool inPlane( const IORegistryPlane * plane ) const;
+ virtual bool inPlane( const IORegistryPlane * plane = 0) const;
/*! @function getDepth
@abstract Counts the maximum number of entries between an entry and the registry root, in a plane.