PrevNextUpHome BREW C++ Class Library & GUI Framework & XML Middleware : SophiaFramework 4.1

26.1. Coding Rules

26.1.1. Naming convention

Table 26.1. Class and macro naming convention

Class Description
SFAName SophiaFramework internal classes.
SFBName SophiaFramework wrapper classes for BREW interfaces.
SFCName SophiaFramework core classes.
SFDName SophiaFramework debugging classes.
SFHName Reserved (not used).
SFIName Reserved (not used).
SFMName SophiaFramework macros
SFPName Reserved (not used).
SFRName SophiaFramework responder classes.
SFTName Reserved (not used).
SFUName Reserved (utility classes of previous SophiaFramework versions).
SFXName SophiaFramework utility classes.
SFYName Reserved (not used).
SFZName Reserved (not used).
SFWName Reserved (not used).

Table 26.2. Function pointer naming convention

Function Pointer Description
NameMPP A pointer to the member function (MPP = Member Procedure Pointer)
NameSPP A pointer to the static function (SPP = Static Procedure Pointer)

26.1.2. Function Argument

For the source code to be readable, when the value of an argument might be changed by the function, the argument of not reference but pointer type is passed.

Example 26.1. SFXRingBuffer::Read() protype

SFCError Read(SFXBufferPtr buffer);
[Note] Note
The return value shows whether the reading is succeeded or not, and data to be read is stored in the argument "buffer".

To pass a constant object to a function, specify the argument of not pointer but const reference type.

Example 26.2. SFXRingBuffer::Write() prototype

SFCError Write(SFXBufferConstRef buffer);

26.1.3. Set, Get Functions

If Set function is called, the value that was set before is lost.

If Get function is called, the value that was set before is not lost.