VSM C++ SDK
Vehicle Specific Modules SDK
request_context.h
Go to the documentation of this file.
1 // Copyright (c) 2014, Smart Projects Holdings Ltd
2 // All rights reserved.
3 // See LICENSE file for license details.
4 
11 #ifndef TASK_CONTEXT_H_
12 #define TASK_CONTEXT_H_
13 
15 
16 namespace ugcs {
17 namespace vsm {
18 
23 template <bool is_processor>
26 public:
29 
31  virtual Type
32  Get_type() const override
33  {
34  return is_processor ? Type::PROCESSOR : Type::COMPLETION_CONTEXT;
35  }
36 
37 private:
42  virtual void
43  Process_request(Request::Ptr request) override
44  {
45  request->Process(is_processor);
46  }
47 };
48 
51 
56 
57 } /* namespace vsm */
58 } /* namespace ugcs */
59 
60 #endif /* TASK_CONTEXT_H_ */
UGCS root namespace.
Definition: android-linux/ugcs/vsm/platform_sockets.h:27
virtual Type Get_type() const override
Get this container type.
Definition: request_context.h:32
Request_context< true > Request_processor
Request processor is a request execution context where request are processed.
Definition: request_context.h:50
std::shared_ptr< Request > Ptr
Pointer type.
Definition: request_container.h:38
Request execution context.
Definition: request_context.h:24
Request container declaration.
Generic container for queued requests.
Definition: request_container.h:31
Type
Container type.
Definition: request_container.h:441
#define DEFINE_COMMON_CLASS(__class_name,...)
Use this macro to define some common attributes for a class.
Definition: utils.h:25
Request_context< false > Request_completion_context
Request completion context is a request execution context where notification about request completion...
Definition: request_context.h:55