Main Content

target.Object Class

Namespace: target

Base class for target types

Description

target.Object is an abstract base class that enables target types to inherit common functionality.

Class Attributes

Abstract
true
HandleCompatible
true

For information on class attributes, see Class Attributes.

Properties

expand all

  • true if object passes validation procedure.

  • false otherwise.

Attributes:

GetAccess
public
SetAccess
private

Data Types: logical

Methods

expand all

Examples

collapse all

To validate the data integrity of target objects, use the IsValid property or the validate method of the target.Object base class.

Consider an example where you create a target.Processor object and associate an existing language implementation with the object.

myProcessor = target.create("Processor");
myProcessor.LanguageImplementations = target.get("LanguageImplementation", ...
                                              "ARM Compatible-ARM Cortex");

To see that the newly created object is not valid, enter myProcessor.IsValid.

myProcessor.IsValid
ans = logical
   0

If you try to validate the object with the method myProcessor.validate(), you get an error.

myProcessor.validate()
Error using target.internal.Processor/validate
Target data validation failed.
 * Undefined property "Name" in "Processor" object.
 * Undefined identifier in "Processor" object.

The validation fails because these target.Processor properties are not specified:

  • Name — Processor name

  • Id — Object identifier

You can specify a processor name, which also specifies the object identifier.

myProcessor.Name = "MyProcessor";

Check the validity of myProcessor again to see that the validity of the object is established.

myProcessor.IsValid
ans = logical
   1

myProcessor.validate()

Note: When you use the target.add function to register a target object, the software also checks the validity of the object.

Version History

Introduced in R2019b