From 7b8fd6165a7cb7287b3cef5a85c267b7dda0e816 Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Tue, 17 Mar 2026 15:47:43 +0700 Subject: [PATCH 1/4] Update Docker for gtk4 --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 80d4f69..2c6bdb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,9 @@ RUN \ # install clang tidy apt-get install -y clang-tidy && \ # install lcov - apt-get install -y lcov + apt-get install -y lcov && \ + # install gtk4 + apt-get install -y libgtkmm-4.0-dev # Set the working directory inside the Docker image WORKDIR /cpp-lab From ccd6ff77131d5cf30458fa30020697173c7bb8d1 Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Tue, 17 Mar 2026 17:00:34 +0700 Subject: [PATCH 2/4] Update doc, correct folder name --- docs/uml/ap/ap_mvc_example.drawio.svg | 4 ++++ docs/uml/{ds => dp}/behavioral_CoR.drawio.svg | 0 docs/uml/{ds => dp}/behavioral_command.drawio.svg | 0 docs/uml/{ds => dp}/behavioral_iterator.drawio.svg | 0 docs/uml/{ds => dp}/behavioral_mediator.drawio.svg | 0 docs/uml/{ds => dp}/behavioral_memento.drawio.svg | 0 docs/uml/{ds => dp}/behavioral_observer.drawio.svg | 0 docs/uml/{ds => dp}/behavioral_state.drawio.svg | 0 docs/uml/{ds => dp}/behavioral_strategy.drawio.svg | 0 docs/uml/{ds => dp}/behavioral_templatemethod.drawio.svg | 0 docs/uml/{ds => dp}/behavioral_visitor.drawio.svg | 0 docs/uml/{ds => dp}/creational_abstractfactory.drawio.svg | 0 docs/uml/{ds => dp}/creational_builder.drawio.svg | 0 docs/uml/{ds => dp}/creational_factorymethod.drawio.svg | 0 docs/uml/{ds => dp}/creational_prototype.drawio.svg | 0 docs/uml/{ds => dp}/creational_singleton.drawio.svg | 0 docs/uml/{ds => dp}/structural_adapter.drawio.svg | 0 docs/uml/{ds => dp}/structural_bridge.drawio.svg | 0 docs/uml/{ds => dp}/structural_composite.drawio.svg | 0 docs/uml/{ds => dp}/structural_decorator.drawio.svg | 0 docs/uml/{ds => dp}/structural_facade.drawio.svg | 0 docs/uml/{ds => dp}/structural_flyweight.drawio.svg | 0 docs/uml/{ds => dp}/structural_proxy.drawio.svg | 0 23 files changed, 4 insertions(+) create mode 100644 docs/uml/ap/ap_mvc_example.drawio.svg rename docs/uml/{ds => dp}/behavioral_CoR.drawio.svg (100%) rename docs/uml/{ds => dp}/behavioral_command.drawio.svg (100%) rename docs/uml/{ds => dp}/behavioral_iterator.drawio.svg (100%) rename docs/uml/{ds => dp}/behavioral_mediator.drawio.svg (100%) rename docs/uml/{ds => dp}/behavioral_memento.drawio.svg (100%) rename docs/uml/{ds => dp}/behavioral_observer.drawio.svg (100%) rename docs/uml/{ds => dp}/behavioral_state.drawio.svg (100%) rename docs/uml/{ds => dp}/behavioral_strategy.drawio.svg (100%) rename docs/uml/{ds => dp}/behavioral_templatemethod.drawio.svg (100%) rename docs/uml/{ds => dp}/behavioral_visitor.drawio.svg (100%) rename docs/uml/{ds => dp}/creational_abstractfactory.drawio.svg (100%) rename docs/uml/{ds => dp}/creational_builder.drawio.svg (100%) rename docs/uml/{ds => dp}/creational_factorymethod.drawio.svg (100%) rename docs/uml/{ds => dp}/creational_prototype.drawio.svg (100%) rename docs/uml/{ds => dp}/creational_singleton.drawio.svg (100%) rename docs/uml/{ds => dp}/structural_adapter.drawio.svg (100%) rename docs/uml/{ds => dp}/structural_bridge.drawio.svg (100%) rename docs/uml/{ds => dp}/structural_composite.drawio.svg (100%) rename docs/uml/{ds => dp}/structural_decorator.drawio.svg (100%) rename docs/uml/{ds => dp}/structural_facade.drawio.svg (100%) rename docs/uml/{ds => dp}/structural_flyweight.drawio.svg (100%) rename docs/uml/{ds => dp}/structural_proxy.drawio.svg (100%) diff --git a/docs/uml/ap/ap_mvc_example.drawio.svg b/docs/uml/ap/ap_mvc_example.drawio.svg new file mode 100644 index 0000000..b22d7f0 --- /dev/null +++ b/docs/uml/ap/ap_mvc_example.drawio.svg @@ -0,0 +1,4 @@ + + + +
C
M
V
Get Data
Update Presentation
Update Data
SharedData
- data_: string
- observers_: vector<IObserver*>

- notifyObservers(): void
+ SharedData()
+ addObserver(IObserver* obs): void

+set/getData
model

<<Interface>>
IObserver


+ onDataChanged(const string& newData)



0..n
view
EditorWidget
- attr..: Gtk...

- controller_: shared_ptr<Controller>

+ EditorWidget(shared_ptr<Controller> c, const string& initData)
DisplayWidget
- attr..: Gtk...

- updateLabel(const string& text)
+ DisplayWidget(const string& title, const string& color, const string& startData)
 regis:

  button_.signal_clicked().connect(
      [this]() { controller_->updateRequest(entry_.get_text()); });
 onDataChanged(newData):

updateLabel(newData)
N/A
controller
Controller
- model_: shared_ptr<Model>
+ Controller(shared_ptr<SharedData> model);

+ updateRequest(const string& text)
1
 setData(data):

this->data_ = data;
notifyObservers()

 notifyObserver:
for( IObserver o : observers_)
 o-> onDataChanged(data_)


0..n
1
 updateRequest(text):

model_.setData(text)
 main

shared_ptr<SharedData> m = make_shared<SharedData>();
shared_ptr<Controller> c = make_shared<Controller>(d)
unique_ptr<EditorWidget> iv = make_unique<EditorWidget>(c); unique_ptr<DisplayWidget> ov1 = make_unique<DisplayWidget>();
unique_ptr<DisplayWidget> ov2 = make_unique<DisplayWidget>();

m.addObserver(ov1.get())
m.addObserver(ov2.get())

// Flow
input -> iv -> press iv's button -> c.updateRequest
-> m.setData -> m.notifyObserver -> ov1,ov2.updateLabel 
\ No newline at end of file diff --git a/docs/uml/ds/behavioral_CoR.drawio.svg b/docs/uml/dp/behavioral_CoR.drawio.svg similarity index 100% rename from docs/uml/ds/behavioral_CoR.drawio.svg rename to docs/uml/dp/behavioral_CoR.drawio.svg diff --git a/docs/uml/ds/behavioral_command.drawio.svg b/docs/uml/dp/behavioral_command.drawio.svg similarity index 100% rename from docs/uml/ds/behavioral_command.drawio.svg rename to docs/uml/dp/behavioral_command.drawio.svg diff --git a/docs/uml/ds/behavioral_iterator.drawio.svg b/docs/uml/dp/behavioral_iterator.drawio.svg similarity index 100% rename from docs/uml/ds/behavioral_iterator.drawio.svg rename to docs/uml/dp/behavioral_iterator.drawio.svg diff --git a/docs/uml/ds/behavioral_mediator.drawio.svg b/docs/uml/dp/behavioral_mediator.drawio.svg similarity index 100% rename from docs/uml/ds/behavioral_mediator.drawio.svg rename to docs/uml/dp/behavioral_mediator.drawio.svg diff --git a/docs/uml/ds/behavioral_memento.drawio.svg b/docs/uml/dp/behavioral_memento.drawio.svg similarity index 100% rename from docs/uml/ds/behavioral_memento.drawio.svg rename to docs/uml/dp/behavioral_memento.drawio.svg diff --git a/docs/uml/ds/behavioral_observer.drawio.svg b/docs/uml/dp/behavioral_observer.drawio.svg similarity index 100% rename from docs/uml/ds/behavioral_observer.drawio.svg rename to docs/uml/dp/behavioral_observer.drawio.svg diff --git a/docs/uml/ds/behavioral_state.drawio.svg b/docs/uml/dp/behavioral_state.drawio.svg similarity index 100% rename from docs/uml/ds/behavioral_state.drawio.svg rename to docs/uml/dp/behavioral_state.drawio.svg diff --git a/docs/uml/ds/behavioral_strategy.drawio.svg b/docs/uml/dp/behavioral_strategy.drawio.svg similarity index 100% rename from docs/uml/ds/behavioral_strategy.drawio.svg rename to docs/uml/dp/behavioral_strategy.drawio.svg diff --git a/docs/uml/ds/behavioral_templatemethod.drawio.svg b/docs/uml/dp/behavioral_templatemethod.drawio.svg similarity index 100% rename from docs/uml/ds/behavioral_templatemethod.drawio.svg rename to docs/uml/dp/behavioral_templatemethod.drawio.svg diff --git a/docs/uml/ds/behavioral_visitor.drawio.svg b/docs/uml/dp/behavioral_visitor.drawio.svg similarity index 100% rename from docs/uml/ds/behavioral_visitor.drawio.svg rename to docs/uml/dp/behavioral_visitor.drawio.svg diff --git a/docs/uml/ds/creational_abstractfactory.drawio.svg b/docs/uml/dp/creational_abstractfactory.drawio.svg similarity index 100% rename from docs/uml/ds/creational_abstractfactory.drawio.svg rename to docs/uml/dp/creational_abstractfactory.drawio.svg diff --git a/docs/uml/ds/creational_builder.drawio.svg b/docs/uml/dp/creational_builder.drawio.svg similarity index 100% rename from docs/uml/ds/creational_builder.drawio.svg rename to docs/uml/dp/creational_builder.drawio.svg diff --git a/docs/uml/ds/creational_factorymethod.drawio.svg b/docs/uml/dp/creational_factorymethod.drawio.svg similarity index 100% rename from docs/uml/ds/creational_factorymethod.drawio.svg rename to docs/uml/dp/creational_factorymethod.drawio.svg diff --git a/docs/uml/ds/creational_prototype.drawio.svg b/docs/uml/dp/creational_prototype.drawio.svg similarity index 100% rename from docs/uml/ds/creational_prototype.drawio.svg rename to docs/uml/dp/creational_prototype.drawio.svg diff --git a/docs/uml/ds/creational_singleton.drawio.svg b/docs/uml/dp/creational_singleton.drawio.svg similarity index 100% rename from docs/uml/ds/creational_singleton.drawio.svg rename to docs/uml/dp/creational_singleton.drawio.svg diff --git a/docs/uml/ds/structural_adapter.drawio.svg b/docs/uml/dp/structural_adapter.drawio.svg similarity index 100% rename from docs/uml/ds/structural_adapter.drawio.svg rename to docs/uml/dp/structural_adapter.drawio.svg diff --git a/docs/uml/ds/structural_bridge.drawio.svg b/docs/uml/dp/structural_bridge.drawio.svg similarity index 100% rename from docs/uml/ds/structural_bridge.drawio.svg rename to docs/uml/dp/structural_bridge.drawio.svg diff --git a/docs/uml/ds/structural_composite.drawio.svg b/docs/uml/dp/structural_composite.drawio.svg similarity index 100% rename from docs/uml/ds/structural_composite.drawio.svg rename to docs/uml/dp/structural_composite.drawio.svg diff --git a/docs/uml/ds/structural_decorator.drawio.svg b/docs/uml/dp/structural_decorator.drawio.svg similarity index 100% rename from docs/uml/ds/structural_decorator.drawio.svg rename to docs/uml/dp/structural_decorator.drawio.svg diff --git a/docs/uml/ds/structural_facade.drawio.svg b/docs/uml/dp/structural_facade.drawio.svg similarity index 100% rename from docs/uml/ds/structural_facade.drawio.svg rename to docs/uml/dp/structural_facade.drawio.svg diff --git a/docs/uml/ds/structural_flyweight.drawio.svg b/docs/uml/dp/structural_flyweight.drawio.svg similarity index 100% rename from docs/uml/ds/structural_flyweight.drawio.svg rename to docs/uml/dp/structural_flyweight.drawio.svg diff --git a/docs/uml/ds/structural_proxy.drawio.svg b/docs/uml/dp/structural_proxy.drawio.svg similarity index 100% rename from docs/uml/ds/structural_proxy.drawio.svg rename to docs/uml/dp/structural_proxy.drawio.svg From 1c7192e796e57b3251f219ee1d7d943bca171d2d Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Tue, 17 Mar 2026 17:02:17 +0700 Subject: [PATCH 3/4] Update doc --- src/ap/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ap/README.md b/src/ap/README.md index 0eaf53b..22aaebd 100644 --- a/src/ap/README.md +++ b/src/ap/README.md @@ -22,6 +22,7 @@ View ↔ ViewModel ↔ Model # view automatically update (data binding) ``` ### 2. MVC +![Diagram](../../docs/uml/ap/ap_mvc_example.drawio.svg) - **MVC (Model - View - Controller)** is an architectural pattern that separates the user interface (`View`) from the application logic and data (`Model`) using an intermediary component called the `Controller`. - **Components:** - **Model**: is responsible for managing and abstracting data sources (databases, APIs, etc.). The `Model` handles data retrieval, storage, and business logic. From 8aec1363fb640aa8a6c883591918df6add2a5f67 Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Tue, 17 Mar 2026 17:02:55 +0700 Subject: [PATCH 4/4] Disable clang-tidy --- .github/workflows/cpp-build-test-coverage.yml | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cpp-build-test-coverage.yml b/.github/workflows/cpp-build-test-coverage.yml index 0495483..c9f71c5 100644 --- a/.github/workflows/cpp-build-test-coverage.yml +++ b/.github/workflows/cpp-build-test-coverage.yml @@ -96,21 +96,21 @@ jobs: echo "## Test Coverage Summary" >> $GITHUB_STEP_SUMMARY lcov --summary coverageFiltered.info >> $GITHUB_STEP_SUMMARY - # ------------------------------------------------------- - # Step 7: Run Clang-Tidy (experimenting , not exit) - # - Modern C++ static analysis - # - Enforces best practices - # - Add `--warnings-as-errors=*` to exit code 1 - # ------------------------------------------------------- - - name: Run clang-tidy - # run: | - # echo "Running clang-tidy..." - # clang-tidy \ - # -checks='clang-analyzer-*,modernize-*,performance-*,readability-*' \ - # -p build \ - # $(find ./src -name '*.cpp') - run: | - echo "Running clang-tidy using .clang-tidy options" - clang-tidy \ - -p build \ - -header-filter='^src/.*' $(find src -name "*.cpp") \ No newline at end of file + # # ------------------------------------------------------- + # # Step 7: Run Clang-Tidy (experimenting , not exit) + # # - Modern C++ static analysis + # # - Enforces best practices + # # - Add `--warnings-as-errors=*` to exit code 1 + # # ------------------------------------------------------- + # - name: Run clang-tidy + # # run: | + # # echo "Running clang-tidy..." + # # clang-tidy \ + # # -checks='clang-analyzer-*,modernize-*,performance-*,readability-*' \ + # # -p build \ + # # $(find ./src -name '*.cpp') + # run: | + # echo "Running clang-tidy using .clang-tidy options" + # clang-tidy \ + # -p build \ + # -header-filter='^src/.*' $(find src -name "*.cpp") \ No newline at end of file