Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "texas/engine/INodeMatchingPool.h"
- #include "texas/engine/MatcherNodeRepoLP.h"
- #include "texas/engine/MatcherNodeRepoLT.h"
- #include "texas/engine/MatchingProcedure.h"
- #include "texas/engine/MatchingNodeEvent.h"
- #include "texas/engine/MatchingPairEvent.h"
- #include "texas/core/RandomLCG.h"
- namespace texas {
- namespace engine {
- class NodeMatchingPool : public INodeMatchingPool,
- public std::enable_shared_from_this<NodeMatchingPool>
- {
- public:
- NodeMatchingPool(IEnumeratorPtr matchEnum, IEnumeratorPtr execEnum);
- NodeMatchingPool(MatcherNodeRepoLPPtr lpRepo, MatcherNodeRepoLTPtr ltRepo,
- IMatchingProcedurePtr matchProc);
- virtual ~NodeMatchingPool();
- virtual MatcherNodePtr Register(IOrderPtr order) override;
- virtual void MatchingPass() override;
- virtual void RemoveMatched(MatcherNodeLPPtr lpNode, MatcherNodeLTPtr ltNode) throw() override;
- virtual void Enter() throw() override;
- virtual void Leave() throw() override;
- virtual void Close() throw() override;
- virtual IEventTypePtr OnOrderRegistered() throw() override;
- virtual IEventTypePtr OnOrderCancelled() throw() override;
- virtual IEventTypePtr OnMatchingPassFinisihed() throw() override;
- virtual IEventTypePtr OnMatched() throw() override;
- virtual MatcherNodeRepoLPPtr GetProviders() throw();
- virtual MatcherNodeRepoLTPtr GetTakers() throw();
- virtual IMatchingProcedurePtr GetMatchingProcedure() throw();
- virtual void SubscribeForAllEvents(IEventListenerPtr listener) override;
- virtual void UnsubscribeAllEvents(IEventListenerPtr listener) override;
- private:
- bool FireMatchingPassFinished();
- void FireOrderRegistered(MatcherNodePtr node);
- CriticalSection m_cs;
- MatcherNodeRepoLPPtr m_lpRepo;
- MatcherNodeRepoLTPtr m_ltRepo;
- IMatchingProcedurePtr m_matchProc;
- IRandomPtr m_random;
- EventTypePtr m_onOrderRegistered, m_onOrderCancelled, m_onMatchingPassFinished, m_onMatched;
- };
- typedef shared_ptr<NodeMatchingPool> NodeMatchingPoolPtr;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement