comparison OrthancServer/OrthancRestApi.h @ 746:478f4f9de9eb

getting rid of macros
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 01 Apr 2014 17:41:50 +0200
parents 2d0a347e8cfc
children
comparison
equal deleted inserted replaced
745:9076a986c451 746:478f4f9de9eb
44 public: 44 public:
45 typedef std::set<std::string> SetOfStrings; 45 typedef std::set<std::string> SetOfStrings;
46 46
47 private: 47 private:
48 ServerContext& context_; 48 ServerContext& context_;
49 SetOfStrings modalities_;
50 SetOfStrings peers_;
51 49
52 public: 50 public:
53 OrthancRestApi(ServerContext& context); 51 OrthancRestApi(ServerContext& context);
54 52
55 ServerContext& GetContext() 53 static ServerContext& GetContext(RestApi::Call& call)
56 { 54 {
57 return context_; 55 OrthancRestApi& that = dynamic_cast<OrthancRestApi&>(call.GetContext());
56 return that.context_;
58 } 57 }
59 58
60 SetOfStrings& GetModalities() 59 static ServerIndex& GetIndex(RestApi::Call& call)
61 { 60 {
62 return modalities_; 61 return GetContext(call).GetIndex();
63 }
64
65 SetOfStrings& GetPeers()
66 {
67 return peers_;
68 } 62 }
69 }; 63 };
70 } 64 }