| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef TOOLS_GN_ITEM_H_ | 5 #ifndef TOOLS_GN_ITEM_H_ |
| 6 #define TOOLS_GN_ITEM_H_ | 6 #define TOOLS_GN_ITEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "tools/gn/input_file.h" |
| 10 #include "tools/gn/label.h" | 11 #include "tools/gn/label.h" |
| 11 #include "tools/gn/visibility.h" | 12 #include "tools/gn/visibility.h" |
| 12 | 13 |
| 13 class Config; | 14 class Config; |
| 14 class ParseNode; | 15 class ParseNode; |
| 15 class Pool; | 16 class Pool; |
| 16 class Settings; | 17 class Settings; |
| 17 class Target; | 18 class Target; |
| 18 class Toolchain; | 19 class Toolchain; |
| 19 | 20 |
| 20 // A named item (target, config, etc.) that participates in the dependency | 21 // A named item (target, config, etc.) that participates in the dependency |
| 21 // graph. | 22 // graph. |
| 22 class Item { | 23 class Item { |
| 23 public: | 24 public: |
| 24 Item(const Settings* settings, const Label& label); | 25 Item(const Settings* settings, |
| 26 const Label& label, |
| 27 const InputFileSet& input_files); |
| 25 virtual ~Item(); | 28 virtual ~Item(); |
| 26 | 29 |
| 27 const Settings* settings() const { return settings_; } | 30 const Settings* settings() const { return settings_; } |
| 28 | 31 |
| 29 // This is guaranteed to never change after construction so this can be | 32 // This is guaranteed to never change after construction so this can be |
| 30 // accessed from any thread with no locking once the item is constructed. | 33 // accessed from any thread with no locking once the item is constructed. |
| 31 const Label& label() const { return label_; } | 34 const Label& label() const { return label_; } |
| 32 | 35 |
| 33 const ParseNode* defined_from() const { return defined_from_; } | 36 const ParseNode* defined_from() const { return defined_from_; } |
| 34 void set_defined_from(const ParseNode* df) { defined_from_ = df; } | 37 void set_defined_from(const ParseNode* df) { defined_from_ = df; } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 48 | 51 |
| 49 // Returns a name like "target" or "config" for the type of item this is, to | 52 // Returns a name like "target" or "config" for the type of item this is, to |
| 50 // be used in logging and error messages. | 53 // be used in logging and error messages. |
| 51 std::string GetItemTypeName() const; | 54 std::string GetItemTypeName() const; |
| 52 | 55 |
| 53 // Called when this item is resolved, meaning it and all of its dependents | 56 // Called when this item is resolved, meaning it and all of its dependents |
| 54 // have no unresolved deps. Returns true on success. Sets the error and | 57 // have no unresolved deps. Returns true on success. Sets the error and |
| 55 // returns false on failure. | 58 // returns false on failure. |
| 56 virtual bool OnResolved(Err* err); | 59 virtual bool OnResolved(Err* err); |
| 57 | 60 |
| 61 const InputFileSet& input_files() const { return input_files_; } |
| 62 |
| 58 private: | 63 private: |
| 59 const Settings* settings_; | 64 const Settings* settings_; |
| 60 Label label_; | 65 Label label_; |
| 61 const ParseNode* defined_from_; | 66 const ParseNode* defined_from_; |
| 62 | 67 |
| 63 Visibility visibility_; | 68 Visibility visibility_; |
| 69 InputFileSet input_files_; |
| 64 }; | 70 }; |
| 65 | 71 |
| 66 #endif // TOOLS_GN_ITEM_H_ | 72 #endif // TOOLS_GN_ITEM_H_ |
| OLD | NEW |