solanaceae_ecosystem/plugins/transfer_auto_accept.hpp

37 lines
868 B
C++
Raw Normal View History

2023-08-19 23:22:33 +02:00
#pragma once
#include <solanaceae/object_store/object_store.hpp>
2023-08-19 23:22:33 +02:00
#include <solanaceae/message3/registry_message_model.hpp>
#include <vector>
// fwd
struct ConfigModelI;
class TransferAutoAccept : public RegistryMessageModelEventI, public ObjectStoreEventI {
ObjectStore2& _os;
2024-10-06 11:56:20 +02:00
RegistryMessageModelI& _rmm;
2023-08-19 23:22:33 +02:00
//ContactModelI& _cm;
ConfigModelI& _conf;
std::vector<ObjectHandle> _accept_queue;
2023-08-19 23:22:33 +02:00
public:
2024-10-06 11:56:20 +02:00
TransferAutoAccept(ObjectStore2& os, RegistryMessageModelI& rmm, ConfigModelI& conf);
2023-08-19 23:22:33 +02:00
// TODO: iterate
void iterate(void);
protected:
void checkObj(ObjectHandle h);
2023-08-19 23:22:33 +02:00
void checkMsg(Message3Handle h);
protected: // mm
bool onEvent(const Message::Events::MessageConstruct& e) override;
bool onEvent(const Message::Events::MessageUpdated& e) override;
protected: // os
bool onEvent(const ObjectStore::Events::ObjectUpdate& e) override;
2023-08-19 23:22:33 +02:00
};