File indexing completed on 2024-05-19 05:42:29

0001 // ct_lvtshr_loaderinfo.cpp                                           -*-C++-*-
0002 
0003 /*
0004 // Copyright 2023 Codethink Ltd <codethink@codethink.co.uk>
0005 // SPDX-License-Identifier: Apache-2.0
0006 //
0007 // Licensed under the Apache License, Version 2.0 (the "License");
0008 // you may not use this file except in compliance with the License.
0009 // You may obtain a copy of the License at
0010 //
0011 //     http://www.apache.org/licenses/LICENSE-2.0
0012 //
0013 // Unless required by applicable law or agreed to in writing, software
0014 // distributed under the License is distributed on an "AS IS" BASIS,
0015 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0016 // See the License for the specific language governing permissions and
0017 // limitations under the License.
0018 */
0019 
0020 #include <ct_lvtshr_loaderinfo.h>
0021 
0022 namespace Codethink::lvtshr {
0023 
0024 LoaderInfo::LoaderInfo() = default;
0025 
0026 LoaderInfo::LoaderInfo(bool hasAllChildren, bool hasParent, bool hasAllEdges):
0027     d_valid(true), d_hasAllChildren(hasAllChildren), d_hasParent(hasParent), d_hasAllEdges(hasAllEdges)
0028 {
0029 }
0030 
0031 bool LoaderInfo::isValid() const
0032 {
0033     return d_valid;
0034 }
0035 
0036 std::optional<bool> LoaderInfo::hasAllChildren() const
0037 {
0038     if (!d_valid) {
0039         return {};
0040     }
0041     return d_hasAllChildren;
0042 }
0043 
0044 std::optional<bool> LoaderInfo::hasParent() const
0045 {
0046     if (!d_valid) {
0047         return {};
0048     }
0049     return d_hasParent;
0050 }
0051 
0052 std::optional<bool> LoaderInfo::hasAllEdges() const
0053 {
0054     if (!d_valid) {
0055         return {};
0056     }
0057     return d_hasAllEdges;
0058 }
0059 
0060 void LoaderInfo::setHasParent(bool hasParent)
0061 {
0062     d_hasParent = hasParent;
0063 }
0064 
0065 } // end namespace Codethink::lvtshr