cmakepp_lang/class/detail/bases

cmakepp_lang/class/detail/bases._cpp_class_get_bases(this bases)

Note

This is a macro, and so does not introduce a new scope.

Encapsulates the logic for retrieving the base classes of a user-defined type.

The type system needs to know which base classes a user-defined class can be implicitly converted to. This function encapsulates the logic of retrieving that list to avoid a direct coupling to how that list is stored.

Note

This function is used by cpp_implicitly_convertible and thus is inside the type-checking machinery which can not have its type checked by cpp_assert_signature. Also worth noting this function is currently a macro because all it does is set a variable for the caller, thus we save a call to cpp_return.

Parameters:
  • this (class) – The class instance we are retrieving the bases of.

  • bases – An identifier to which the list of base classes will be assigned.

  • bases – desc

Returns:

bases will be set to the list of base classes that the user-defined type stored in this derives from. This is not the list of base classes that the Class class derives from.

Return type:

[type]

Error Checking

This function will ensure that it has been called with exactly two arguments, and if it has not, will raise an error.

cmakepp_lang/class/detail/bases._cpp_class_set_bases(this bases)
Encapsulates the logic for setting the base classes of a user-defined

type.

The type system needs to know which base classes a user-defined class can be implicitly converted to. This function encapsulates the logic of setting that list to avoid a direct coupling to how that list is stored. If the bases for a class have already been set this function will overwrite the previous list.

Parameters:
  • this (class) – The class instance we are setting the bases of.

  • bases – An identifier containing the list of base classes.

  • bases – [type]*

Variables:

CMAKEPP_LANG_DEBUG_MODE (bool) – Used to determine if CMakePP is being run in debug mode or not.

Error Checking

If CMakePP is run in debug mode (and only when it is) this function will assert that the caller supplied exactly two arguments and that those arguments have the correct types.