Difference between revisions of "C plus plus version"

From WikiManual
Jump to: navigation, search
m (See also)
Line 1: Line 1:
 
I propose we discuss the C++ design and coding standards in here. A wiki is much handier then a forum or PM's for it.
 
I propose we discuss the C++ design and coding standards in here. A wiki is much handier then a forum or PM's for it.
 +
 +
Original document by Taldor, comments by Numsgil in <font color="Red"> Red </font>
  
 
== C++ design ==
 
== C++ design ==
Line 5: Line 7:
 
=== General concepts ===
 
=== General concepts ===
  
* Class based approach.
+
* Class based approach. <font color="Red"> In some cases, procedural in others.  It's a value decision I'll make as I port the code. </font>
* Portable code.
+
* Portable code. <font color="Red"> Where possible.  Preferably in house or free library wrappers for non portable functions, such as multithreading and OS timers. </font>
  
 
=== Structure ===
 
=== Structure ===
 +
<font color="Red"> See the present VB code </font>
  
 
* Main
 
* Main
Line 20: Line 23:
  
 
To be used everywhere:
 
To be used everywhere:
* Vector_4 (using [http://www.boost.org/libs/numeric/ublas/doc uBLAS])
+
* Vector_4 (using [http://www.boost.org/libs/numeric/ublas/doc uBLAS]) <font color="Red"> Present vector class is from [http://www.gamedev.net/reference/articles/article605.asp this article].  I'll use whichever is fastest, feel free to perfrom benchamrks </font>
* Matrix_4 (also using uBLAS)
+
* Matrix_4 (also using uBLAS) <font color="Red"> See above </font>
* Random (using 'srand()' and 'rand()')
+
* Random (using 'srand()' and 'rand()') <font color="Red"> See [http://library.lanl.gov/numerical/ the chapter on random numbers]</font>
* Object (the base class)
+
* Object (the base class) <font color="Red"> Depends on the class </font>
  
 
== C++ coding standards ==
 
== C++ coding standards ==
  
 
I would use:
 
I would use:
#C++
+
#C++ <font color="Red"> C++ libraries where such libraries do what I want them to do, C libraries otherwise.  Another value decision. </font>
#Four spaced tabs
+
#Four spaced tabs - <font color="Red"> Aye. </font>
#External librairies when possible (ie. [http://www.boost.org/ Boost])
+
#External librairies when possible (ie. [http://www.boost.org/ Boost]) <font color="Red"> Internal libraries where possible, to decrease the number of code dependancies, except where external libraries perform the job faster/more comoprehensively than internal libraries can. </font>
#[http://www.libsdl.org SDL]
+
#[http://www.libsdl.org SDL] <font color="Red"> Dunno, haven't looked into graphics libraries yet. </font>
 
#...
 
#...
  

Revision as of 15:47, 30 October 2005

I propose we discuss the C++ design and coding standards in here. A wiki is much handier then a forum or PM's for it.

Original document by Taldor, comments by Numsgil in Red

C++ design

General concepts

  • Class based approach. In some cases, procedural in others. It's a value decision I'll make as I port the code.
  • Portable code. Where possible. Preferably in house or free library wrappers for non portable functions, such as multithreading and OS timers.

Structure

See the present VB code

  • Main
    • Engine
      • User Interface
      • Darwin (the simulation engine)
        • Veg
        • Tie
        • Robot
          • Sense

To be used everywhere:

  • Vector_4 (using uBLAS) Present vector class is from this article. I'll use whichever is fastest, feel free to perfrom benchamrks
  • Matrix_4 (also using uBLAS) See above
  • Random (using 'srand()' and 'rand()') See the chapter on random numbers
  • Object (the base class) Depends on the class

C++ coding standards

I would use:

  1. C++ C++ libraries where such libraries do what I want them to do, C libraries otherwise. Another value decision.
  2. Four spaced tabs - Aye.
  3. External librairies when possible (ie. Boost) Internal libraries where possible, to decrease the number of code dependancies, except where external libraries perform the job faster/more comoprehensively than internal libraries can.
  4. SDL Dunno, haven't looked into graphics libraries yet.
  5. ...

See also

  1. RoundTable
  2. C/C++ Reference
  3. C++ FAQ Lite