F´ Style Guidelines · nasa/fprime Wiki · GitHub
Skip to content

F´ Style Guidelines

Rob Bocchino edited this page Jun 11, 2026 · 5 revisions

Note: this document is under review and is subject to change.

This document will capture the style guide for developing F´ projects. These recommendations apply to F´ framework code. Projects developing using F´ are recommended to use these standards but are not required to do so.

Note: not all framework code currently follows these guidelines. Newly submitted code shall follow these guidelines, and updating existing code is a work in progress.

Name Guidelines

This section will recommend naming style for various items withing F´.

Constants, enumeration values, and compiler directives: shall be defined in all-uppercase with tokens separated by '_' underscore.

Example:

#define MY_DEFINITION 1234

const U32 MY_CONSTANT = 3;

enum EnumType {
    VALUE_SUCCESS = ...,
    VALUE_FAILURE = ...
}

Local Variables and Global Variables: shall be named in lower camel case, that is, starting with a lowercase letter with a capital letter starting each token.

Example:

U32 myVariable = 2;

Member Variables: shall be named as local variables with a prefix of "m_".

Example:

U32 m_myMemberVariable;

Functions and Member Functions: shall be named in lower camel case just as local variables.

Types, Components, Ports, Classes, Packages, Namespaces, Modules: shall use Pascal case, that is, a leading capital letter with additional capitals at the start of each token.

Example

Svc.ComStub // FPP form
Svc::ComStub // C++ form

Notice that the FPP module, C++ namespace, and component name all are defined in Pascal case.

Module Directory Structure

F´ constructs are each defined in a module and breakdown into several categories: Types, Ports, Components, and Typologies. Modules are grouped into various packages including framework (Fw), drivers (Drv), service components (Svc), etc. Modules within packages shall be organized into the following structure.

Ports and Types: these folders shall respectively fall into named package sub-folders "Ports" and "Types".

Example: Fw.SuccessPort Port

Fw/Ports/SuccessPort/

Notice that the SuccessPort module folder is placed in the "Ports" sub-directory if the Fw Package. Type module folders would be placed in "Types".

Components: module directories are placed directly in the package directory.

Example: Svc.ComStub Component

Svc/ComStub/

Topologies: shall be placed in the "Top" folder of a deployment's package.

Example: Ref Topology

Ref/Top

Referring to Class Members

Instance Members

When referring to class instance members (variables and functions), prefix the name with this->.

Example:

this->m_myMemberVariable = 1;
this->myMemberFunction();

Static Members

When referring to static class members (variables, and functions), prefix the name with the enclosing class name:

Example:

ClassName::m_myStaticVariable = 1;
ClassName::myStaticFunction();

Clone this wiki locally