blob: 36ba554addca9a2c63a73aef8638a3881a9b821c [file] [log] [blame]
Alex Vakulenko7c36b672014-07-16 14:50:58 -07001// Copyright 2014 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef BUFFET_COMMANDS_COMMAND_DEFINITION_H_
6#define BUFFET_COMMANDS_COMMAND_DEFINITION_H_
7
8#include <memory>
9#include <string>
10
11#include <base/basictypes.h>
12
13#include "buffet/commands/object_schema.h"
14
15namespace buffet {
16
17// A simple GCD command definition. This class contains the command category
18// and a full object schema describing the command parameter types and
19// constraints. See comments for CommandDefinitions::LoadCommands for the
20// detailed description of what command categories are and what they are used
21// for.
22class CommandDefinition {
23 public:
24 CommandDefinition(const std::string& category,
25 const std::shared_ptr<const ObjectSchema>& parameters);
26
27 // Gets the category this command belongs to.
28 const std::string& GetCategory() const { return category_; }
29 // Gets the object schema for command parameters.
30 const std::shared_ptr<const ObjectSchema>& GetParameters() const {
31 return parameters_;
32 }
33
34 private:
35 std::string category_; // Cmd category. Could be "powerd" for "base.reboot".
36 std::shared_ptr<const ObjectSchema> parameters_; // Command parameter def.
37 DISALLOW_COPY_AND_ASSIGN(CommandDefinition);
38};
39
40} // namespace buffet
41
42#endif // BUFFET_COMMANDS_COMMAND_DEFINITION_H_