Skip to content

Commit

Permalink
add __PLOOC_CLASS_IMPLEMENT__ and __PLOOC_CLASS_INHERIT__
Browse files Browse the repository at this point in the history
  • Loading branch information
GorgonMeducer committed Aug 5, 2020
1 parent 097b796 commit b69becd
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 18 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ If you have any questions or suggestions, please feel free to let us know.

## Update Log
---
- \[05/08/2020\] Add \_\_PLOOC\_CLASS\_IMPLEMENT\_\_ and \_\_PLOOC\_CLASS\_INHERIT\_\_ version 4.5.6
- use \_\_xxxxx\_\_ as emphasis because \_\_xxxxx usually means "internal"
- The original \_\_PLOOC\_CLASS\_IMPLEMENT and \_\_PLOOC\_CLASS\_INHERIT are deprecated and will be kept for a while before completely removed.
- \[18/05/2020\] Introduce both short- and long- style of macro, version 4.5.5
- dcl_xxxxx/declare_xxxxx
- def_xxxx/define_xxxxx; end_def_xxxx/end_define_xxxx
Expand Down
4 changes: 2 additions & 2 deletions example/byte_queue/byte_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ typedef struct mem_t {
#define __PLOOC_CLASS_USE_STRICT_TEMPLATE__

#if defined(__BYTE_QUEUE_CLASS_IMPLEMENT)
# define __PLOOC_CLASS_IMPLEMENT
# define __PLOOC_CLASS_IMPLEMENT__
#elif defined(__BYTE_QUEUE_CLASS_INHERIT)
# define __PLOOC_CLASS_INHERIT
# define __PLOOC_CLASS_INHERIT__
#endif

#include "plooc_class.h"
Expand Down
4 changes: 2 additions & 2 deletions example/enhanced_byte_queue/enhanced_byte_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
#define __PLOOC_CLASS_USE_STRICT_TEMPLATE__

#if defined(__ENHANCED_BYTE_QUEUE_CLASS_IMPLEMENT)
# define __PLOOC_CLASS_IMPLEMENT
# define __PLOOC_CLASS_IMPLEMENT__
# undef __ENHANCED_BYTE_QUEUE_CLASS_IMPLEMENT
#elif defined(__ENHANCED_BYTE_QUEUE_CLASS_INHERIT)
# define __PLOOC_CLASS_INHERIT
# define __PLOOC_CLASS_INHERIT__
# undef __ENHANCED_BYTE_QUEUE_CLASS_INHERIT
#endif

Expand Down
26 changes: 21 additions & 5 deletions example/project/mdk/plooc_example.uvprojx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<TargetName>arm_compiler_6_example</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6140000::V6.14.0.2 (dev drop 2)::..\..\Program Files\ARMCompiler6.14Internal</pCCUsed>
<pCCUsed>6150000::V6.15.0.1 dev::.\ARMCompiler6.15</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
Expand Down Expand Up @@ -185,6 +185,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
Expand Down Expand Up @@ -336,7 +337,7 @@
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls>-fms-extensions -Wno-microsoft-anon-tag -Wno-empty-body</MiscControls>
<Define>_MSC_VER</Define>
<Define>_MSC_VER __OOC_DEBUG__</Define>
<Undefine></Undefine>
<IncludePath>..\mdk;..\..\..\example;..\..\..\..\PLOOC</IncludePath>
</VariousControls>
Expand All @@ -351,7 +352,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
Expand Down Expand Up @@ -487,8 +488,8 @@
<RTE>
<apis/>
<components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.4.0" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.7.0-dev0"/>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.3.0" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.6.0"/>
<targetInfos>
<targetInfo name="arm_compiler_6_example"/>
</targetInfos>
Expand Down Expand Up @@ -528,4 +529,19 @@
</files>
</RTE>

<LayerInfo>
<Layers>
<Layer>
<LayName>&lt;Project Info&gt;</LayName>
<LayDesc></LayDesc>
<LayUrl></LayUrl>
<LayKeys></LayKeys>
<LayCat></LayCat>
<LayLic></LayLic>
<LayTarg>0</LayTarg>
<LayPrjMark>1</LayPrjMark>
</Layer>
</Layers>
</LayerInfo>

</Project>
2 changes: 2 additions & 0 deletions plooc_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ extern "C" {
#undef __PLOOC_CLASS_USE_SIMPLE_TEMPLATE__
#undef __PLOOC_CLASS_USE_BLACK_BOX_TEMPLATE__
#undef __PLOOC_CLASS_IMPLEMENT
#undef __PLOOC_CLASS_IMPLEMENT__
#undef __PLOOC_CLASS_INHERIT__
#undef __PLOOC_CLASS_INHERIT

#if defined(__cplusplus)
Expand Down
4 changes: 3 additions & 1 deletion plooc_class_black_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern "C" {
#undef __class
/*============================ MACROFIED FUNCTIONS ===========================*/

#if defined(__PLOOC_CLASS_IMPLEMENT)
#if defined(__PLOOC_CLASS_IMPLEMENT__) || defined(__PLOOC_CLASS_IMPLEMENT)

# ifdef __OOC_DEBUG__
# define __def_class(__NAME, __PUBLIC ,...) \
Expand Down Expand Up @@ -237,6 +237,8 @@ extern "C" {
/*============================ LOCAL VARIABLES ===============================*/
/*============================ PROTOTYPES ====================================*/

#undef __PLOOC_CLASS_IMPLEMENT__
#undef __PLOOC_CLASS_INHERIT__
#undef __PLOOC_CLASS_IMPLEMENT
#undef __PLOOC_CLASS_INHERIT

Expand Down
10 changes: 6 additions & 4 deletions plooc_class_simple.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ extern "C" {
# define protected_member(...) PLOOC_VISIBLE(__VA_ARGS__)
# define public_member(...) PLOOC_VISIBLE(__VA_ARGS__)

#elif defined(__PLOOC_CLASS_IMPLEMENT)
#elif defined(__PLOOC_CLASS_IMPLEMENT__) || defined(__PLOOC_CLASS_IMPLEMENT)

# define private_member(...) PLOOC_VISIBLE(__VA_ARGS__)
# define protected_member(...) PLOOC_VISIBLE(__VA_ARGS__)
# define public_member(...) PLOOC_VISIBLE(__VA_ARGS__)

#elif defined(__PLOOC_CLASS_INHERIT)
#elif defined(__PLOOC_CLASS_INHERIT__) || defined(__PLOOC_CLASS_INHERIT)

# define private_member(...) PLOOC_INVISIBLE(__VA_ARGS__)
# define protected_member(...) PLOOC_VISIBLE(__VA_ARGS__)
Expand Down Expand Up @@ -109,7 +109,7 @@ extern "C" {
};


#if defined(__PLOOC_CLASS_IMPLEMENT)
#if defined(__PLOOC_CLASS_IMPLEMENT__) || defined(__PLOOC_CLASS_IMPLEMENT)

# undef __class
# define __class(__NAME) __NAME
Expand Down Expand Up @@ -144,7 +144,7 @@ extern "C" {

#define __end_extern_class(...)

#elif defined(__PLOOC_CLASS_INHERIT)
#elif defined(__PLOOC_CLASS_INHERIT__) || defined(__PLOOC_CLASS_INHERIT)

# undef __class_protected
# define __class_protected(__NAME) __NAME
Expand Down Expand Up @@ -205,6 +205,8 @@ extern "C" {

#define end_extern_class(__NAME, ...) __end_extern_class(__NAME, __VA_ARGS__)

#undef __PLOOC_CLASS_IMPLEMENT__
#undef __PLOOC_CLASS_INHERIT__
#undef __PLOOC_CLASS_IMPLEMENT
#undef __PLOOC_CLASS_INHERIT
/*============================ TYPES =========================================*/
Expand Down
7 changes: 5 additions & 2 deletions plooc_class_simple_c90.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extern "C" {
};


#if defined(__PLOOC_CLASS_IMPLEMENT)
#if defined(__PLOOC_CLASS_IMPLEMENT__) || defined(__PLOOC_CLASS_IMPLEMENT)

# undef __class
# define __class(__NAME) __NAME
Expand All @@ -112,7 +112,7 @@ extern "C" {

#define __end_extern_class(__NAME)

#elif defined(__PLOOC_CLASS_INHERIT)
#elif defined(__PLOOC_CLASS_INHERIT__) || defined(__PLOOC_CLASS_INHERIT)

# undef __class_protected
# define __class_protected(__NAME) __NAME
Expand Down Expand Up @@ -157,8 +157,11 @@ extern "C" {

#define end_extern_class(__name) __end_extern_class(__name)

#undef __PLOOC_CLASS_IMPLEMENT__
#undef __PLOOC_CLASS_INHERIT__
#undef __PLOOC_CLASS_IMPLEMENT
#undef __PLOOC_CLASS_INHERIT

/*============================ TYPES =========================================*/
/*============================ GLOBAL VARIABLES ==============================*/
/*============================ LOCAL VARIABLES ===============================*/
Expand Down
6 changes: 4 additions & 2 deletions plooc_class_strict.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ extern "C" {
/*============================ MACROFIED FUNCTIONS ===========================*/


#if defined(__PLOOC_CLASS_IMPLEMENT)
#if defined(__PLOOC_CLASS_IMPLEMENT__) || defined(__PLOOC_CLASS_IMPLEMENT)

# define __def_class2(__NAME, _1) \
typedef struct __NAME __NAME; \
Expand Down Expand Up @@ -220,7 +220,7 @@ extern "C" {
__class_internal(__SRC, __DES, __TYPE, __VA_ARGS__)


#elif defined(__PLOOC_CLASS_INHERIT)
#elif defined(__PLOOC_CLASS_INHERIT__) || defined(__PLOOC_CLASS_INHERIT)

# define __def_class2(__NAME, _1) \
typedef struct __NAME __NAME; \
Expand Down Expand Up @@ -456,6 +456,8 @@ extern "C" {
#define end_extern_class(...) __end_extern_class(__VA_ARGS__)


#undef __PLOOC_CLASS_IMPLEMENT__
#undef __PLOOC_CLASS_INHERIT__
#undef __PLOOC_CLASS_IMPLEMENT
#undef __PLOOC_CLASS_INHERIT
/*============================ TYPES =========================================*/
Expand Down

0 comments on commit b69becd

Please sign in to comment.