target.Object - Base class for target types - MATLAB (original) (raw)

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.

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

Error using target.internal.Processor/validate Target data validation failed.

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

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.

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