IModelObject interface (dbgmodel.h)

The IModelObject interface encapsulates the notion of an object -- whether that object is an integer, a string, some complex type in the target address space of the debugger.

Inheritance

IModelObject inherits from IUnknown.

Methods

The IModelObject interface has these methods.

 
IModelObject::AddParentModel

The AddParentModel method adds a new parent model to the given object.
IModelObject::AddRef

The AddRef method increments the reference count for an interface on an object. This method belongs to the IModelObject interface.
IModelObject::ClearConcepts

The ClearConcepts method will remove all concepts from the instance of the object specified by this.
IModelObject::ClearKeys

The ClearKeys method removes all keys and their associated values and metadata from the instance of the object specified by this.
IModelObject::Compare

The Compare method compares two model objects and returns an indication of how those objects relate.
IModelObject::Dereference

The Dereference method dereferences an object.
IModelObject::EnumerateKeyReferences

The EnumerateKeyReferences method behaves similar to the EnumerateKeyValues method excepting that it returns references to the keys it enumerates instead of the value of the key.
IModelObject::EnumerateKeys

Enumerates the keys within the dynamic key provider.
IModelObject::EnumerateKeyValues

The EnumerateKeyValues method is the first method a client will turn to in order to enumerate all of the keys on an object.
IModelObject::EnumerateRawReferences

The EnumerateRawReferences method enumerates references to all native children (fields, base classes, etc...) of the given object.
IModelObject::EnumerateRawValues

The EnumerateRawValues method enumerates all native children (fields, base classes, etc...) of the given object.
IModelObject::GetConcept

The GetConcept method will search for a concept on the object (or its parent model chain) and return an interface pointer to the concept interface.
IModelObject::GetContext

The GetContext method returns the host context that is associated with the object.
IModelObject::GetContextForDataModel

The GetContextForDataModel method is used to retrieve context information which was set up with a prior call to SetContextForDataModel.
IModelObject::GetIntrinsicValue

The GetIntrinsicValue method returns the thing which is boxed inside an IModelObject.
IModelObject::GetIntrinsicValueAs

The GetIntrinsicValueAs method behaves much as the GetIntrinsicValue method excepting that it converts the value to the specified variant type.
IModelObject::GetKey

The GetKey method will get the value of (and the metadata associated with) a given key by name.
IModelObject::GetKeyReference

If the object or one of its parent models has a key named according to the argument 'key', this will return a reference to that key.
IModelObject::GetKeyValue

The GetKeyValue method is the first method a client will turn to in order to get the value of (and the metadata associated with) a given key by name.
IModelObject::GetKind

The GetKind method returns what kind of object is boxed inside the IModelObject.
IModelObject::GetLocation

The GetLocation method will return the location of the native object. While such a location is typically a virtual address within the address space of the debug target, it is not necessarily so.
IModelObject::GetNumberOfParentModels

The GetNumberOfParentModels method returns the number of parent models which are attached to the given object instance.
IModelObject::GetParentModel

The GetParentModel method returns the i-th parent model in the parent model chain of the given object.
IModelObject::GetRawReference

The GetRawReference method finds a native construct within the given object and returns a reference to it.
IModelObject::GetRawValue

The GetRawValue method finds a native construct within the given object. Such a construct may be a field, a base class, a field in a base class, a member function, etc.
IModelObject::GetTargetInfo

The GetTargetInfo method is effectively a combination of the GetLocation and GetTypeInfo methods returning both the abstract location as well as native type of the given object.
IModelObject::GetTypeInfo

The GetTypeInfo method will return the native type of the given object. If the object does not have native type information associated with it the call will still succeed but will return null.
IModelObject::IsEqualTo

The IsEqualTo method compares a host context to another host context. If the two contexts are equivalent, an indication of this is returned. Note that this comparison is not interface equivalence.
IModelObject::QueryInterface

The IModelObject::QueryInterface method retrieves pointers to the supported interfaces on an object.
IModelObject::Release

The IModelObject::Release method decrements the reference count for an interface on an object.
IModelObject::RemoveParentModel

The RemoveParentModel will remove a specified parent model from the parent search chain of the given object.
IModelObject::SetConcept

The SetConcept method will place a specified concept on the object instance specified by the this pointer.
IModelObject::SetContextForDataModel

The SetContextForDataModel method is used by the implementation of a data model to place implementation data on instance objects.
IModelObject::SetKey

The SetKey method is the method a client will turn to in order to create a key on an object (and potentially associate metadata with the created key).
IModelObject::SetKeyValue

The SetKeyValue method is the first method a client will turn to in order to set the value of a key. This method cannot be used to create a new key on an object.
IModelObject::TryCastToRuntimeType

The TryCastToRuntimeType method will ask the debug host to perform an analysis and determine the actual runtime type (most derived class) of the given object.

Remarks

One of the most basic yet powerful things about the data model is that it standardizes the definition of what an object is and how one interacts with an object. The IModelObject interface encapsulates the notion of an object -- whether that object is an integer, a floating point value, a string, some complex type in the target address space of the debugger, or some debugger concept like the notion of a process or a module.

There are several different things that can be held in (or boxed into) an IModelObject:

• Intrinsic Values - An IModelObject can be a container for a number of basic types: 8, 16, 32, or 64 bit signed or unsigned integers, booleans, strings, errors, or the notion of empty.

• Native Objects - An IModelObject can represent a complex type (as defined by the debugger's type system) within the address space of whatever the debugger is targeting

• Synthetic Objects - An IModelObject can be a dynamic object -- a dictionary if you will: a collection of key / value / metadata tuples and a set of concepts which define behaviors that aren't simply represented by key / value pairs.

• Properties - An IModelObject can represent a property: something whose value can be retrieved or altered with a method call. A property within an IModelObject is effectively an IModelPropertyAccessor interface boxed into an IModelObject

• Methods - An IModelObject can represent a method: something you can call with a set of arguments and get a return value. A method within an IModelObject is effectively an IModelMethod interface boxed into an IModelObject

An IModelObject is not an object in isolation. In addition to representing one of the types of objects shown above, each object has the notion of a chain of parent data models. This chain behaves much like a | JavaScript prototype chain. Instead of a linear chain of prototypes like JavaScript has, each data model object defines a linear chain of parent models. Each of those parent models in turn has another linear chain of its own set of parents. In essence, each object is an aggregation of the capabilities (properties, etc...) of both itself and every object in this tree. When a specific property is queried, if the object it is queried on does not support that property, the query is passed in linear order to each parent in turn. This creates a behavior where the search for a property is resolved by a depth-first search of the aggregate tree.

Extensibility within this object model is very simple given this notion that every object is an aggregate of itself and the tree of parent models. An extension can come in and add itself into the list of parent models for another object. Doing this extends the object. In this manner, it is possible to add capabilities onto anything: a particular instance of an object or value, a native type, the debugger's concept of what a process or thread is, or even the notion of "all iterable objects".

Requirements

Requirement Value
Header dbgmodel.h

See also

Debugger Data Model C++ Interfaces Overview