Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2015
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.02 KB | None | 0 0
  1. #pragma once
  2. #include "texas/engine/INodeMatchingPool.h"
  3. #include "texas/engine/MatcherNodeRepoLP.h"
  4. #include "texas/engine/MatcherNodeRepoLT.h"
  5. #include "texas/engine/MatchingProcedure.h"
  6. #include "texas/engine/MatchingNodeEvent.h"
  7. #include "texas/engine/MatchingPairEvent.h"
  8. #include "texas/core/RandomLCG.h"
  9.  
  10. namespace texas {
  11.     namespace engine {
  12.  
  13.         class NodeMatchingPool : public INodeMatchingPool,
  14.             public std::enable_shared_from_this<NodeMatchingPool>
  15.         {
  16.         public:
  17.             NodeMatchingPool(IEnumeratorPtr matchEnum, IEnumeratorPtr execEnum);
  18.             NodeMatchingPool(MatcherNodeRepoLPPtr lpRepo, MatcherNodeRepoLTPtr ltRepo,
  19.                 IMatchingProcedurePtr matchProc);
  20.             virtual ~NodeMatchingPool();
  21.             virtual MatcherNodePtr Register(IOrderPtr order) override;
  22.             virtual void MatchingPass() override;
  23.             virtual void RemoveMatched(MatcherNodeLPPtr lpNode, MatcherNodeLTPtr ltNode) throw() override;
  24.             virtual void Enter() throw() override;
  25.             virtual void Leave() throw() override;
  26.             virtual void Close() throw() override;
  27.             virtual IEventTypePtr OnOrderRegistered() throw() override;
  28.             virtual IEventTypePtr OnOrderCancelled() throw() override;
  29.             virtual IEventTypePtr OnMatchingPassFinisihed() throw() override;
  30.             virtual IEventTypePtr OnMatched() throw() override;
  31.             virtual MatcherNodeRepoLPPtr GetProviders() throw();
  32.             virtual MatcherNodeRepoLTPtr GetTakers() throw();
  33.             virtual IMatchingProcedurePtr GetMatchingProcedure() throw();
  34.             virtual void SubscribeForAllEvents(IEventListenerPtr listener) override;
  35.             virtual void UnsubscribeAllEvents(IEventListenerPtr listener) override;
  36.         private:
  37.             bool FireMatchingPassFinished();
  38.             void FireOrderRegistered(MatcherNodePtr node);
  39.  
  40.             CriticalSection m_cs;
  41.             MatcherNodeRepoLPPtr m_lpRepo;
  42.             MatcherNodeRepoLTPtr m_ltRepo;
  43.             IMatchingProcedurePtr m_matchProc;
  44.             IRandomPtr m_random;
  45.             EventTypePtr m_onOrderRegistered, m_onOrderCancelled, m_onMatchingPassFinished, m_onMatched;
  46.  
  47.         };
  48.  
  49.         typedef shared_ptr<NodeMatchingPool> NodeMatchingPoolPtr;
  50.  
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement