PrevNextUpHome SophiaFramework UNIVERSE 5.3

28.1. Coding Rules

28.1.1. Naming convention

Table 28.1. Class and macro naming convention

Class Description
SFAName Internal classes of SophiaFramework UNIVERSE.
SFBName Wrapper classes for BREW interfaces of SophiaFramework UNIVERSE.
SFCName Core classes of SophiaFramework UNIVERSE.
SFDName Debugging classes of SophiaFramework UNIVERSE.
SFHName Reserved (not used).
SFIName Reserved (not used).
SFMName Macros of SophiaFramework UNIVERSE.
SFOName Reference counting classes of SophiaFramework UNIVERSE.
SFPName Constant values of SophiaFramework UNIVERSE.
SFRName SFR responder classes of SophiaFramework UNIVERSE.
SFTName Reserved (not used).
SFUName Reserved (utility classes of previous SophiaFramework versions).
SFXName SophiaFramework utility classes.
SFYName SFY responder classes of SophiaFramework UNIVERSE.
SFZName SFZ responder classes of SophiaFramework UNIVERSE.
SFWName Reserved (not used).

Table 28.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)

28.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 28.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 28.2. SFXRingBuffer::Write() prototype

SFCError Write(SFXBufferConstRef buffer);

28.1.3. Set, Get Functions

In SophiaFramework UNIVERSE, there are the Set function and the Get function in many classes. The Set function operates on its object destructively and the Get function operates on its object non-destructively as follows:

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

If an error does not orror in calling the Set function, the value that has been set before will be lost. Otherwise, the value that has been set before will never be overridden.

However, the Set function that does not return no errors always override the object with the value of its argument. For example, the Set function of SFXGraphics, SFXResponderPointer, SFXBrewPointer and so on is this kind of function.

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