Fix to use width and height correctly in flex-layout-impl.cpp
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / third-party / yoga / YGFloatOptional.h
1 /**
2  * Copyright (c) 2014-present, Facebook, Inc.
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 #pragma once
9
10 struct YGFloatOptional {
11  private:
12   float value_;
13   bool isUndefined_;
14
15  public:
16   explicit YGFloatOptional(const float& value);
17   explicit YGFloatOptional();
18
19   // Program will terminate if the value of an undefined is accessed. Please
20   // make sure to check if the optional is defined before calling this function.
21   // To check if float optional is defined, use `isUndefined()`.
22   const float& getValue() const;
23
24   // Sets the value of float optional, and thus isUndefined is assigned false.
25   void setValue(const float& val);
26
27   const bool& isUndefined() const;
28
29   YGFloatOptional operator+(const YGFloatOptional& op);
30   bool operator>(const YGFloatOptional& op) const;
31   bool operator<(const YGFloatOptional& op) const;
32   bool operator>=(const YGFloatOptional& op) const;
33   bool operator<=(const YGFloatOptional& op) const;
34   bool operator==(const YGFloatOptional& op) const;
35   bool operator!=(const YGFloatOptional& op) const;
36
37   bool operator==(const float& val) const;
38   bool operator!=(const float& val) const;
39 };