Size: 2628
Comment:
|
Size: 2697
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
* Use .hxx and .cxx and prefix all header files with "cl". Example: clTransaction.hxx, transaction.cxx | * Use .hxx and .cxx and prefix all header files with "cl". ''example:'' clTransaction.hxx, transaction.cxx |
Line 5: | Line 6: |
examples: ''clLogApi.hxx'', ''clCkptApi.hxx'' '''An application only needs to include these files (they must include other required header files)!''' |
''examples:'' ''clLogApi.hxx'', ''clCkptApi.hxx'' '''An application only needs to include these files'''. These files must include any other required header files. |
Line 8: | Line 10: |
examples: ''clTransaction.hxx'' '''An application MAY include these files if it wants that specific functionality''' |
''examples:'' ''clTransaction.hxx'' '''An application MAY include these files''' if it wants that specific functionality. |
Line 11: | Line 14: |
examples: ''clCkptIpi.hxx'' | ''examples:'' ''clCkptIpi.hxx'' |
Line 52: | Line 56: |
''Example:'' | |
Line 87: | Line 91: |
'''''With pointers, predeclarations are preferred''''' | ''Example:'' '''''With pointers, predeclarations are preferred''''' |
Files
- Use .hxx and .cxx and prefix all header files with "cl".
example: clTransaction.hxx, transaction.cxx
Name major functional blocks cl<FN>Api.hxx
examples: clLogApi.hxx, clCkptApi.hxx
An application only needs to include these files. These files must include any other required header files.
- Other files can be named based on the primary class defined inside
examples: clTransaction.hxx
An application MAY include these files if it wants that specific functionality.
Internal APIs should be named cl<something>Ipi.hxx
examples: clCkptIpi.hxx
These files may get pulled into application builds due to object containment. However, it must not be necessary for the application program to ever use symbols defined in the Ipi files.
Definitions
All application-level APIs must be defined under the SAFplus namespace:
All internal APIs must be defined under the SAFplusI namespace (I for internal):
- Do not hide implementation using handles.
- Expose them via pointers or containment. This makes debugging much simpler and its easy enough just to skip over tracing through the implementation if needed. Also, prefer containment; do not use pointers rather than containment just to hide implementation.
Example: clSvcIpi.hxx
clSvcApi.hxxNote that in this case, the application will end up including the Ipi file. This is ok, it is clear by the namespace what is API and what is internal.Example: With pointers, predeclarations are preferred
- Expose them via pointers or containment. This makes debugging much simpler and its easy enough just to skip over tracing through the implementation if needed. Also, prefer containment; do not use pointers rather than containment just to hide implementation.