solanaceae_ecosystem/plugins/transfer_auto_accept.hpp

37 lines
866 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;
2023-08-19 23:22:33 +02:00
RegistryMessageModel& _rmm;
//ContactModelI& _cm;
ConfigModelI& _conf;
std::vector<ObjectHandle> _accept_queue;
2023-08-19 23:22:33 +02:00
public:
TransferAutoAccept(ObjectStore2& os, RegistryMessageModel& 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
};