Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi/OrthancRestApi.h @ 1437:02f5a3f5c0a0
access to the REST API from Lua
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 30 Jun 2015 18:41:33 +0200 |
parents | 6e7e5ed91c2d |
children | 1b7def486e62 |
comparison
equal
deleted
inserted
replaced
1436:0a3e3be59094 | 1437:02f5a3f5c0a0 |
---|---|
32 | 32 |
33 #pragma once | 33 #pragma once |
34 | 34 |
35 #include "../../Core/RestApi/RestApi.h" | 35 #include "../../Core/RestApi/RestApi.h" |
36 #include "../DicomModification.h" | 36 #include "../DicomModification.h" |
37 #include "../ServerContext.h" | |
38 | 37 |
39 #include <set> | 38 #include <set> |
40 | 39 |
41 namespace Orthanc | 40 namespace Orthanc |
42 { | 41 { |
42 class ServerContext; | |
43 class ServerIndex; | |
44 | |
43 class OrthancRestApi : public RestApi | 45 class OrthancRestApi : public RestApi |
44 { | 46 { |
45 public: | 47 public: |
46 typedef std::set<std::string> SetOfStrings; | 48 typedef std::set<std::string> SetOfStrings; |
47 | 49 |
74 static OrthancRestApi& GetApi(RestApiCall& call) | 76 static OrthancRestApi& GetApi(RestApiCall& call) |
75 { | 77 { |
76 return dynamic_cast<OrthancRestApi&>(call.GetContext()); | 78 return dynamic_cast<OrthancRestApi&>(call.GetContext()); |
77 } | 79 } |
78 | 80 |
79 static ServerContext& GetContext(RestApiCall& call) | 81 static ServerContext& GetContext(RestApiCall& call); |
80 { | |
81 return GetApi(call).context_; | |
82 } | |
83 | 82 |
84 static ServerIndex& GetIndex(RestApiCall& call) | 83 static ServerIndex& GetIndex(RestApiCall& call); |
85 { | |
86 return GetContext(call).GetIndex(); | |
87 } | |
88 | 84 |
89 void AnswerStoredInstance(RestApiPostCall& call, | 85 void AnswerStoredInstance(RestApiPostCall& call, |
90 const std::string& publicId, | 86 const std::string& publicId, |
91 StoreStatus status) const; | 87 StoreStatus status) const; |
92 | 88 |