| 1 | // -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*- |
| 2 | |
| 3 | /****************************************************************************** |
| 4 | * |
| 5 | * file: ArgContainer.h |
| 6 | * |
| 7 | * Copyright (c) 2018 Google LLC |
| 8 | * All rights reserved. |
| 9 | * |
| 10 | * See the file COPYING in the top directory of this distribution for |
| 11 | * more information. |
| 12 | * |
| 13 | * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 14 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 16 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 18 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 19 | * DEALINGS IN THE SOFTWARE. |
| 20 | * |
| 21 | *****************************************************************************/ |
| 22 | |
| 23 | #ifndef TCLAP_ARG_CONTAINER_H |
| 24 | #define TCLAP_ARG_CONTAINER_H |
| 25 | |
| 26 | namespace TCLAP { |
| 27 | |
| 28 | class Arg; |
| 29 | |
| 30 | /** |
| 31 | * Interface that allows adding an Arg to a "container". |
| 32 | * |
| 33 | * A container does not have to be a container in the C++ standard |
| 34 | * library sense, just something that wants to hold on to references |
| 35 | * to Arg's. The container does not own the added Arg's and it is the |
| 36 | * user's responsibility to ensure the life time (scope) of the Arg's |
| 37 | * outlives any operations on the container. |
| 38 | */ |
| 39 | class ArgContainer { |
| 40 | public: |
| 41 | virtual ~ArgContainer() {} |
| 42 | |
| 43 | /** |
| 44 | * Adds an argument. Ownership is not transfered. |
| 45 | * \param a - Argument to be added. |
| 46 | */ |
| 47 | virtual ArgContainer &add(Arg &a) = 0; |
| 48 | |
| 49 | /** |
| 50 | * Adds an argument. Ownership is not transfered. |
| 51 | * \param a - Argument to be added. |
| 52 | */ |
| 53 | virtual ArgContainer &add(Arg *a) = 0; |
| 54 | }; |
| 55 | |
| 56 | } // namespace TCLAP |
| 57 | |
| 58 | #endif // TCLAP_ARG_CONTAINER_H |