############################# cmakepp_lang/class/class_decl ############################# .. module:: cmakepp_lang/class/class_decl Defines functions to declare a user-defined CMakePPLang class. .. data:: __CMAKEPP_LANG_CLASS_TEMPLATE__ Template file for creating a class. :Default value: ${CMAKE_CURRENT_LIST_DIR}/detail/class.cmake.in :type: str .. function:: cpp_class(type) .. note:: This is a macro, and so does not introduce a new scope. Creates a new class of the specified type. This command is used to start the declaration of a new user-defined type. The resulting user-defined type will automatically inherit from ``Object`` if no base classes are provided, otherwise it will inherit from the specified base classes (users of this command should never explicitly specify inheritance from ``Object``). :param type: The name of the class whose declaration is being started. :type type: desc :param \*args: The various base classes that the class should inherit from. :var CMAKEPP_LANG_DEBUG_MODE: Used to determine if CMakePP is being run in debug mode or not. :vartype CMAKEPP_LANG_DEBUG_MODE: bool .. note:: This command is a macro to ensure that the functions generated by this command are in scope to the caller. Error Checking ============== If CMakePP is run in debug mode (and only if it is run in debug mode) this function will assert that it was called with at least one argument and that the arguments have the correct types. .. function:: cpp_end_class() .. note:: This is a macro, and so does not introduce a new scope. Denotes that we are done declaring a class. This function is a no-op that completes the fencing associated with declaring a class. Error Checking ============== None. This function is a no-op and has no errors to check for. .. function:: _cpp_class_guts(type wrapper) Creates the new class This function is factored out of ``cpp_class`` and contains the logic required to actually create the class. This logic is factored out primarily to avoid contaminating the caller's namespace with intermediate results. :param type: The name of the class being created. :type type: desc :param wrapper: Name for variable which will hold the path to the class's implementation. :type wrapper: desc :param \*args: The base classes that this class derives from. :returns: ``_cg_wrapper`` will be set to the absolute file path for the generated module which implements the class. :rtype: path