diff --git a/connections/clients/windows/strategy_w.cc b/connections/clients/windows/strategy_w.cc index ee75f30e..6d27f89f 100644 --- a/connections/clients/windows/strategy_w.cc +++ b/connections/clients/windows/strategy_w.cc @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - #include "connections/clients/windows/strategy_w.h" +#include + namespace location::nearby::windows { const StrategyW StrategyW::kNone = {StrategyW::ConnectionType::kNone, @@ -28,6 +28,22 @@ const StrategyW StrategyW::kP2pPointToPoint{ StrategyW::ConnectionType::kPointToPoint, StrategyW::TopologyType::kOneToOne}; +// static +const StrategyW& StrategyW::GetStrategyNone() { return StrategyW::kNone; } + +// static +const StrategyW& StrategyW::GetStrategyP2pCluster() { + return StrategyW::kP2pCluster; +} + +// static +const StrategyW& StrategyW::GetStrategyP2pStar() { return StrategyW::kP2pStar; } + +// static +const StrategyW& StrategyW::GetStrategyPointToPoint() { + return StrategyW::kP2pPointToPoint; +} + constexpr StrategyW::StrategyW() : StrategyW(kNone) {} bool StrategyW::IsNone() const { return *this == kNone; } diff --git a/connections/clients/windows/strategy_w.h b/connections/clients/windows/strategy_w.h index 02708c6a..cb3c1eb2 100644 --- a/connections/clients/windows/strategy_w.h +++ b/connections/clients/windows/strategy_w.h @@ -32,6 +32,12 @@ class DLL_API StrategyW { constexpr StrategyW(const StrategyW&) = default; constexpr StrategyW& operator=(const StrategyW&) = default; + // Helper functions for exe to access static member variables in the dll. + static const StrategyW& GetStrategyNone(); + static const StrategyW& GetStrategyP2pCluster(); + static const StrategyW& GetStrategyP2pStar(); + static const StrategyW& GetStrategyPointToPoint(); + // Returns true, if strategy is kNone, false otherwise. bool IsNone() const; @@ -42,7 +48,7 @@ class DLL_API StrategyW { // Returns a string representing given strategy, for every valid strategy. std::string GetName() const; - // Undefine strategy. + // Undefined strategy. void Clear(); friend bool operator==(const StrategyW& lhs, const StrategyW& rhs); friend bool operator!=(const StrategyW& lhs, const StrategyW& rhs);