OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef TOOLS_GN_ITEM_H_ |
| 6 #define TOOLS_GN_ITEM_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "tools/gn/label.h" |
| 11 |
| 12 class Config; |
| 13 class Target; |
| 14 class Toolchain; |
| 15 |
| 16 // A named item (target, config, etc.) that participates in the dependency |
| 17 // graph. |
| 18 class Item { |
| 19 public: |
| 20 Item(const Label& label); |
| 21 virtual ~Item(); |
| 22 |
| 23 const Label& label() const { return label_; } |
| 24 |
| 25 // Manual RTTI. |
| 26 virtual Config* AsConfig(); |
| 27 virtual const Config* AsConfig() const; |
| 28 virtual Target* AsTarget(); |
| 29 virtual const Target* AsTarget() const; |
| 30 virtual Toolchain* AsToolchain(); |
| 31 virtual const Toolchain* AsToolchain() const; |
| 32 |
| 33 // Returns a name like "target" or "config" for the type of item this is, to |
| 34 // be used in logging and error messages. |
| 35 std::string GetItemTypeName() const; |
| 36 |
| 37 // Called when this item is resolved, meaning it and all of its dependents |
| 38 // have no unresolved deps. |
| 39 virtual void OnResolved() {} |
| 40 |
| 41 private: |
| 42 Label label_; |
| 43 }; |
| 44 |
| 45 #endif // TOOLS_GN_ITEM_H_ |
OLD | NEW |