https://github.com/alishbz/bridge_pattern
It is a demo of creating a pipeline between two objects with c language without using global data.
https://github.com/alishbz/bridge_pattern
bridge-pattern c
Last synced: 11 months ago
JSON representation
It is a demo of creating a pipeline between two objects with c language without using global data.
- Host: GitHub
- URL: https://github.com/alishbz/bridge_pattern
- Owner: Alishbz
- Created: 2023-07-12T12:24:10.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-23T13:54:40.000Z (over 2 years ago)
- Last Synced: 2025-02-08T14:12:48.199Z (about 1 year ago)
- Topics: bridge-pattern, c
- Language: C
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bridge_pattern
It is a demo of creating a pipeline between two objects with c language without using global data.
In the Demo there is two example particion,
1- bridge_pattern_test.c/.h example
2- Wifi <-> USB (.c/.h) tasks comminication example -> for do that abstract interface -> bridge.h
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
# Main Logic
Imagine a container object , name is -> CX_AREA , it can hold any data, or list , or queue. Can be manageable.
- BRIDGE_OBJ_CREATE( CX_AREA ); -> Create CX_AREA in local area
Imagine a pointer , name is -> CXP, and it hook to CX_AREA, and another pointer to pointer hooks to CXP and its name is -> CXPP.
- BRIDGE_CONNECTION_ASSIGN(CX_AREA, namex, wifi , usb );
And this pointers Created with in main tasks object. ->
- BRIDGE_FIRST_PILE_CREATE( namex );
- BRIDGE_SECOND_PILE_CREATE( namex ); ( İf you wanna create doubleway)
And Of course load the bridges ->
- BRIDGE_FIRST_PILE_INIT(namex,me);
- BRIDGE_SECOND_PILE_INIT(namex,me); ( İf you wanna create doubleway)
Then its ready to connected
- BRIDGE_GOTO_CROSS(namex, me, wifi_obj_t); (or reverse)
CXPP can reach CXP and it can reach main local area, or reverse.
And if these are crossed, it becomes a doubleway!
In essence, it's a memory tricking technique, and it's pretty useful. Especially in multi-threaded embedded software projects, you can develop multi-modular software.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
# Requirements
------
'PURE and OOP C'
Visual Studio 2022 for test.
it can be use in every Hardware/PC/Framework.
# Contact
------
Created By Ali Sahbaz
-> ali_sahbaz@outlook.com
-> [MY LINKEDIN ACCOUNT](https://www.linkedin.com/in/ali-%C5%9Fahbaz-6588a8115/)