Недавно я задал вопрос о записи заголовка иерархии here. Я получил ответ и отметил его как решение. Но через некоторое время у меня есть дополнительный вопрос по этой теме. Как насчет вложенных типов? Я хочу, чтобы в моем заголовочном файле иерархии типов отображались также вложенные типы. Например (см. TODO, пожалуйста):Как объявить вложенные типы в файле заголовка иерархии?
/*
hierarchy.h
© Andrey Bushman, 12 July 2013
This file contains the full hierarchy of this application's types. This file
must be included into the each header file of this application.
*/
//-----------------------------------------------------------------------------
#ifndef BUSH_HIERARCHY_H
#define BUSH_HIERARCHY_H
#include <iostream>
#include <string>
#include <exception>
//*****************************************************************************
namespace Bushman{
//*****************************************************************************
namespace Common{
// run-time checked narrowing cast (type conversion)
template <class R, class A> inline R narrow_cast(const A& a);
// Throw the exception with the msg message.
void error(const std::string& msg);
}
//*****************************************************************************
namespace CAD_Calligraphy{
class Shp_istream; // Stream for SHP file reading.
class Shp_ostream; // Stream for SHP file writing.
class Token; // Token of the SHP file.
// TODO: The next both rows is not allowed (for nested types):
enum Token::Type; // Type of Token item.
class Token::Some_inner_class; // Class for internal use in the Token.
}
//*****************************************************************************
}
#endif
Без вложенных типов иерархия типов не будет заполнена. Как я могу решить эту проблему?
P.S. Я могу написать в комментариях информацию о вложенных типах. Я думаю, что это единственное решение. Я прав?
спасибо.