CAA基础之Coding Rules

1、Create a Header File for each C++ or C Entity

2、Use Preprocessor Directives to Enclose Your Header File Contents

1 #ifndef CATBaseUnknown_h
2 #define CATBaseUnknown_h
3 
4 ... // Put here the #include statements,
5 ... // forward class declarations, and the class stuff
6 
7 #endif

3、Use #include Judiciously

1>Use #include to include the header file of the base class

2>Use #include to include the header file of a class when an instance of this class is used as a data member

3>Use the class forward declaration when a reference of, a value, or a pointer to a class is used as a method returned value or parameter, or if a pointer to a class is used as a data member

(Do not include C++ header files, such as stream.h or iostream.h, if they are useless, since they can include static data that is in any case allocated whatever the way you use these files.)

4、Do Not Use namespace Statements、threads、template、Multiple Inheritance、Virtual Inheritance

5、Avoid Defining Static Data Members

主要内容可以查找:CAADoc/Doc/online/CAACenV5Default.htm/Guide/CAA V5 Coding Rules

 

posted @ 2017-03-01 22:00  一介草民李八千  阅读(143)  评论(0)    收藏  举报