Skip to content

[Feature Request] Make XPCF_IGNORE the default regarding generation of gRPC clients and services #24

Description

@jim-bcom

PROBLEM

  • Our project contains quite a lot of XPCF components subject to have gRPC files being generated by xpcf_grpc_gen.
  • We want to generate those files only for a subset of these classes
  • We must use XPCF_IGNORE macro for a majority of component and keep XPCF_CLIENTUUID/XPCF_SERVERUUID only for a handful of classes, because, IIUC, unannotated class uses generated UUIDs :

ProxyGenerator.cpp

xpcf::uuids::uuid proxyUUID = c->getClientUUID();
    if (proxyUUID.is_nil()) {
        proxyUUID = c->createClientUUID();
        m_serviceUuidMap[m_className] = xpcf::uuids::to_string(proxyUUID);
    }
  • => this can be tedious and hard to check we haven't forgotten to add an XPCF_IGNORE somewhere as it will likely generate files we do not use, and only increase compilation time to our project that uses those generated files.

SUGGESTED SOLUTION

  • Invert the default, and consider an unannotated class to be ignored, and explicitely add annotation for generation.

For example:

  • set both UUIDs
class XPCF_CLIENTUUID("...") XPCF_SERVERUUID("...") MyClass:
    virtual public org::bcom::xpcf::IComponentIntrospect {
  • set only one UUID, let the other one be generated (error if not both are set?)
class XPCF_CLIENTUUID("...") XPCF_SERVERUUID_AUTO MyClass:
    virtual public org::bcom::xpcf::IComponentIntrospect {
  • no annotation -> ignored
class MyClass:
    virtual public org::bcom::xpcf::IComponentIntrospect {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions