Ocean
Loading...
Searching...
No Matches
TestDataCollection.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_TEST_TEST_DATA_COLLECTION_H
9#define META_OCEAN_TEST_TEST_DATA_COLLECTION_H
10
11#include "ocean/test/Test.h"
12#include "ocean/test/TestData.h"
13
14namespace Ocean
15{
16
17namespace Test
18{
19
20// Forward declaration.
21class TestDataCollection;
22
23/**
24 * Definition of a shared pointer holding data TestDataCollection object.
25 * @param test
26 */
27using SharedTestDataCollection = std::shared_ptr<TestDataCollection>;
28
29/**
30 * This class is the base class for all TestDataCollection objects.
31 * The class holds a collection of several test data objects all belonging to the same test category.
32 * @ingroup test
33 */
34class OCEAN_TEST_EXPORT TestDataCollection
35{
36 public:
37
38 /**
39 * Destructs this object.
40 */
41 virtual ~TestDataCollection() = default;
42
43 /**
44 * Returns the test data object associated with a specified index.
45 * @param index The index of the test data object, with range [0, size())
46 * @return The specified test data object, nullptr if the object does not exist
47 */
48 virtual SharedTestData data(const size_t index) = 0;
49
50 /**
51 * Returns the number of data object objects this collection holds.
52 * @return The collection's test data objects, with range [0, infinity)
53 */
54 virtual size_t size() = 0;
55};
56
57}
58
59}
60
61#endif // META_OCEAN_TEST_TEST_DATA_COLLECTION_H
This class is the base class for all TestDataCollection objects.
Definition TestDataCollection.h:35
virtual size_t size()=0
Returns the number of data object objects this collection holds.
virtual ~TestDataCollection()=default
Destructs this object.
virtual SharedTestData data(const size_t index)=0
Returns the test data object associated with a specified index.
std::shared_ptr< TestData > SharedTestData
Definition of a shared pointer holding a TestData object.
Definition TestData.h:29
std::shared_ptr< TestDataCollection > SharedTestDataCollection
Definition of a shared pointer holding data TestDataCollection object.
Definition TestDataCollection.h:27
The namespace covering the entire Ocean framework.
Definition Accessor.h:15