{"id":15047769,"url":"https://github.com/massimo-marino/active-class","last_synced_at":"2026-02-11T01:32:13.671Z","repository":{"id":162666639,"uuid":"96410043","full_name":"massimo-marino/active-class","owner":"massimo-marino","description":"A C++17 implementation of an active class: an active class generates a thread and controls it using functional objects passed by the client application","archived":false,"fork":false,"pushed_at":"2018-08-13T10:44:08.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T18:33:36.463Z","etag":null,"topics":["active-class","cpp","cpp17","cpp1z","functional-objects","googletest","multithreading","multithreading-library","thread"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/massimo-marino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-06T08:59:10.000Z","updated_at":"2018-08-13T10:44:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"c324a0fa-a5b4-4152-b7c6-c8fe7f15483f","html_url":"https://github.com/massimo-marino/active-class","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-marino%2Factive-class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-marino%2Factive-class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-marino%2Factive-class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-marino%2Factive-class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/massimo-marino","download_url":"https://codeload.github.com/massimo-marino/active-class/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243495495,"owners_count":20299923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["active-class","cpp","cpp17","cpp1z","functional-objects","googletest","multithreading","multithreading-library","thread"],"created_at":"2024-09-24T21:04:20.765Z","updated_at":"2026-02-11T01:32:08.648Z","avatar_url":"https://github.com/massimo-marino.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# active-class\nA C++17 implementation of an active class: an active class generates a thread and controls it using functional objects passed by the client application\n\n## Requirements\n\n`cmake` is used to compile the sources.\n\nThe default compiler used is `clang++-5.0`.\n\nThe cmake files compile with `-std=c++17`.\n\nThe unit tests are implemented in `googletest`: be sure you have installed `googletest` to compile.\n\n\n## Install and Run Unit Tests\n\n```bash\n$ git clone https://github.com:massimo-marino/active-class.git\n$ cd active-class\n$ mkdir build\n$ cd build\n$ cmake ..\n$ make\n$ cd src/unitTests\n$ ./unitTests\n```\nThe unit tests provide examples of usage of active classes.\n\n\n## The Active Class\n\nThe active class generates a thread whose function runs a sequence of three client provided functional objects:\n\n- a prologue\n- a body\n- an epilogue\n\nAll the above functional objects are unary functions whose unique argument is a data structure provided by the calling application.\n\nThe prologue and the epilogue return a `bool`, the body returns a client defined type.\n\nThe thread runs as follows:\n\n```C++\nbool epilogueResult{};\nbool prologueResult = prologue(threadData);\nif ( false == prologueResult )\n{\n  body(threadData);\n  epilogueResult = epilogue(threadData);\n}\n```\nSee the class [activeClass](https://github.com/massimo-marino/active-class/blob/master/src/activeClass.h#L60) and its method [void activeClassBody()](https://github.com/massimo-marino/active-class/blob/master/src/activeClass.h#L182)  for the details.\n\nThe unit tests named `runThreadOK_1`, `runThreadOK_2`, and `runThreadOK_3` provide examples of usage of the active class concept.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmassimo-marino%2Factive-class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmassimo-marino%2Factive-class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmassimo-marino%2Factive-class/lists"}