{"id":24649213,"url":"https://github.com/onepointert/passengercpp","last_synced_at":"2025-10-05T19:53:18.467Z","repository":{"id":251824318,"uuid":"837595228","full_name":"onepointerT/passengercpp","owner":"onepointerT","description":"A library that is havening a passenger arriving and departing node graph with and without actions on edges","archived":false,"fork":false,"pushed_at":"2025-03-01T18:03:47.000Z","size":4565,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T19:10:15.456Z","etag":null,"topics":["arithmetic-computation","control","graph","passengers","svg"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onepointerT.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":"2024-08-03T12:43:40.000Z","updated_at":"2025-03-01T18:03:50.000Z","dependencies_parsed_at":"2024-08-25T19:44:26.115Z","dependency_job_id":"7a16b33d-5be9-41ed-ae23-c8bb80d0b574","html_url":"https://github.com/onepointerT/passengercpp","commit_stats":null,"previous_names":["onepointert/passengercpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/onepointerT/passengercpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onepointerT%2Fpassengercpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onepointerT%2Fpassengercpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onepointerT%2Fpassengercpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onepointerT%2Fpassengercpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onepointerT","download_url":"https://codeload.github.com/onepointerT/passengercpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onepointerT%2Fpassengercpp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260553567,"owners_count":23027019,"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":["arithmetic-computation","control","graph","passengers","svg"],"created_at":"2025-01-25T17:16:21.558Z","updated_at":"2025-10-05T19:53:18.378Z","avatar_url":"https://github.com/onepointerT.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# passengercpp\r\n### A library that is havening a passenger arriving and departing node graph with and without actions on edges\r\n#### v0.2.1\r\n\r\nThis small library is implemented to handle concurrent consent arbitrary passengers of nodes and solves the following questions to source code and graph marker member departure behaviour:\r\n\r\n* Which members need to be arrived to start at this node\r\n* Which members are accepted at the node\r\n* Which members are already arrived at the node\r\n* How many members can arrive at a node\r\n* Does an edge have an action to implement, and if any, it will be absolved\r\n\r\n## How does it work\r\n\r\nAn edge can define an action function to absolve per edge. An Action function has the signature `parameter_list_t (*action_function)(GraphPassenger, std::string)`, where `GraphPassenger` is the member marker of the absolving passenger and `std::string` is the name of one of the functions that are available to `Action` and can be defined with `ActionFunction` from `action.hpp`. Once a function is absolved by the `GraphPassenger`, a parameter list of the calculated values will be handed out to `GraphPassenger::absolvedActionFunction`, which then calls the virtual function `GraphPassenger::absolvedFunction`, that can be defined in inheritors of `GraphPassenger`, so that every update of the named (key, value)-pairs will call an update to the inheriting class of `GraphPassenger`, e.g. when passing an edge or combining passenger markers at a `PassengerNode`.\r\n\r\nStart your first passenger node with the class `PassengerNode`. Each passenger node has a stack of members (inherited class `GraphPassengerNumber`) that are allowed to arrive and take place at the `PassengerNode`.\r\n\r\nThe following example shows how a 3-node graph with two edges can be created, use simple actions at the edges and fullfil.\r\n\r\n```c++\r\n#include \"action.hpp\"\r\n#include \"edge.hpp\"\r\n#include \"graph.hpp\"\r\n#include \"graph_passenger.hpp\"\r\n#include \"passenger.hpp\"\r\n\r\n#include \u003ciostream\u003e\r\n#include \u003cstring\u003e\r\n\r\ntypedef typename GraphPassengerNumber\u003c unsigned int \u003e GraphPassengerT;\r\ntypedef typename Action\u003c GraphPassengerT \u003e ActionT;\r\ntypedef typename EdgeToNode\u003c GraphPassengerT, ActionT \u003e EdgeT;\r\ntypedef typename PassengerNode\u003c GraphPassengerT, EdgeT \u003e PassengerNodeT;\r\ntypedef typename Graph\u003c PassengerNodeT \u003e GraphT;\r\n\r\nGraphT graph();\r\n\r\nstruct functions {\r\n    parameter_list_t nextEdge( GraphPassengerT\u0026 passenger, std::string funcname ) {\r\n        std::out \u003c\u003c \"Passing edge and arriving at next node\" \u003c\u003c std::endl;\r\n        return parameter_list_t{ did: \"next_edge\" };\r\n    }\r\n\r\n    parameter_list_t leaveStart( GraphPassengerT\u0026 passenger, std::string funcname ) {\r\n        std::out \u003c\u003c \"Leaving start node to first node\" \u003c\u003c std::endl;\r\n        return parameter_list_t{ nodes_passed: \"1\", nodes_left: std::to_string(graph.size()-1) };\r\n    }\r\n\r\n    parameter_list_t arriveEnd( GraphPassengerT\u0026 passenger, std::string funcname ) {\r\n        std::out \u003c\u003c \"Leaving pre-last node to end node\" \u003c\u003c std::endl;\r\n        return parameter_list_t{ nodes_passed: std::to_string(graph.size()-1), nodes_left: \"1\" };\r\n    }\r\n};\r\n\r\n// Now a few actions\r\nActionFunction actionfunction_startEdge( \"leaveStart\", \u0026functions::leaveStart );\r\nActionFunction actionfunction_endEdge( \"arriveEnd\", \u0026functions::arriveEnd );\r\nActionFunction actionfunction_nextEdge( \"nextEdge\", \u0026functions::nextEdge );\r\n\r\nActionT actions();\r\naction.register_function( actionfunction_startEdge );\r\naction.register_function( actionfunction_endEdge );\r\naction.register_function( actionfunction_nextEdge );\r\n\r\n// Now our nodes\r\nPassengerNodeT* node_start = new PassengerNodeT( PassengerNumber\u003c\u003e() );\r\nPassengerNodeT* node_end = new PassengerNodeT( PassengerNumber\u003c\u003e() );\r\nPassengerNodeT* node_middle = new PassengerNodeT( PassengerNumber\u003c\u003e() );\r\n\r\n// Register the nodes\r\ngraph.reset_start( node_start );\r\ngraph.reset_end( node_end );\r\n\r\n// Create edges\r\nEdgeT edge_middle( actions, node_middle );\r\nnode_start-\u003eadd_edge( edge_middle );\r\nEdgeT edge_end( actions, node_end );\r\nnode_middle-\u003eadd_edge( edge_end );\r\n\r\n// Add passengers\r\nGraphPassengerT p1( \"me\" );\r\nGraphPassengerT p2( \"you\" );\r\ngraph.send_to_start( p1 );\r\ngraph.send_to_start( p2 );\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonepointert%2Fpassengercpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonepointert%2Fpassengercpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonepointert%2Fpassengercpp/lists"}