rossvideo / Catena

Other
6 stars 2 forks source link

shared constraints shouldn't be references #235

Open mejohnnaylor opened 1 month ago

mejohnnaylor commented 1 month ago

The schema currently allows members of the shared constraints object (part of the device object) to be references.

Overly complex and confusing. Let's change the schema to make this invalid.

mejohnnaylor commented 3 weeks ago

the same restriction applied to ParamDescriptors that are inherited via the template_oid mechanism. What I did there was this:

    let fqoid = `${parentOid}/${oid}`;
    if (~p.isTemplated()) {
      this.templateParams[fqoid] = new TemplateParam(objectType, init);
    }

The param object, p, knows whether it's templated or not on construction. The only params that are available to inherit from are in the templateParams object, owned by cppgen.

We can do the same with constraints.

i.e. create a constraints.js that's along the same lines as params.js inasmuch as it defines a cppCtor sub-class that can then be used by cppgen.js and params.js to process their constraints