Coding Standards in C++

Increasingly, our projects and teams span more programming languages.

The coding standards for C++ presented below are designed specifically for consistency with these existing Coding Standards in C#.

Coding Templates

One coding template example is below and the rest are available on GitHub.

/**
 *   CONTRIBUTORS:
 *   Sam Rivello - sam@UnityGameDeveloper.com
 *   -------------------------------------------------------------------------------------------------
 */

#ifndef TemplateClass_hpp
#define TemplateClass_hpp
#include <iostream>
using namespace std;

namespace RMC { namespace Core { namespace Templates
{
    
    class TemplateClass
    {
        private:
        
        //  Fields -------------------------------------------------------------------------------
        string _samplePrivateText;
            
        public:
        
        //  Initialization -----------------------------------------------------------------------
        TemplateClass(void);
    
        //  Methods ------------------------------------------------------------------------------
        string SamplePublicMethod (string message);
    
        //  Event Handlers -----------------------------------------------------------------------
        void Target_OnEventOccurred (void);
    };
}}}

#endif
/**
 *   CONTRIBUTORS:
 *   Sam Rivello - sam@UnityGameDeveloper.com
 *   -------------------------------------------------------------------------------------------------
 */

#include "TemplateClass.hpp"

namespace RMC { namespace Core { namespace Templates
{
    //  Fields ---------------------------------------------------------------------------------------
    string _samplePrivateText;
    
    //  Properties -----------------------------------------------------------------------------------
    string SamplePublicText() { return _samplePrivateText; }
    void SamplePublicText(string v) { _samplePrivateText = v; }
    
    //  Initialization -------------------------------------------------------------------------------
    TemplateClass::TemplateClass (void)
    {
        
    }
    
    //  Methods --------------------------------------------------------------------------------------
    string SamplePublicMethod (string message)
    {
        return message;
    }
    
    //  Event Handlers -------------------------------------------------------------------------------
    void Target_OnEventOccurred ()
    {
        
    }
}}}

Leave a Reply

Your email address will not be published.