В заголовке файла код является:Значение Macro определения кода ниже
#define ClassTP(TNm, PNm) \
class TNm; \
typedef TPt<TNm> PNm; \
class TNm{ \
private: \
TCRef CRef; \
public: \
friend class TPt<TNm>;
Почему есть TNm{
там без }
следующего его образуют пару, это законно? И я понятия не имею, в чем смысл этого кода.
Затем в других файлах, макрокоманды определения используется следующим образом:
ClassTP(TNotify, PNotify)//{
private:
TNotify(const TNotify&);
TNotify& operator=(const TNotify&);
public:
TNotify(){}
virtual ~TNotify(){}
virtual void OnNotify(const TNotifyType& /*Type*/, const TStr& /*MsgStr*/){}
virtual void OnStatus(const TStr& /*MsgStr*/){}
virtual void OnLn(const TStr& /*MsgStr*/){}
virtual void OnTxt(const TStr& /*MsgStr*/){}
// shortcuts for easier formationg
void OnNotifyFmt(const TNotifyType& Type, const char *FmtStr, ...);
void OnStatusFmt(const char *FmtStr, ...);
void OnLnFmt(const char *FmtStr, ...);
void OnTxtFmt(const char *FmtStr, ...);
static TStr GetTypeStr(
const TNotifyType& Type, const bool& Brief=true);
static void OnNotify(const PNotify& Notify,
const TNotifyType& Type, const TStr& MsgStr){
if (!Notify.Empty()){Notify->OnNotify(Type, MsgStr);}}
static void OnStatus(const PNotify& Notify, const TStr& MsgStr){
if (!Notify.Empty()){Notify->OnStatus(MsgStr);}}
static void OnLn(const PNotify& Notify, const TStr& MsgStr){
if (!Notify.Empty()){Notify->OnLn(MsgStr);}}
static void OnTxt(const PNotify& Notify, const TStr& MsgStr){
if (!Notify.Empty()){Notify->OnTxt(MsgStr);}}
static void DfOnNotify(const TNotifyType& Type, const TStr& MsgStr);
static const PNotify NullNotify;
static const PNotify StdNotify;
static const PNotify StdErrNotify;
};
В первой строке этого, есть ClassTP(TNotify, PNotify)//{
мне интересно почему браслет закомментирован оригинальный программист и не он код может работать нормально.