Fix link error when linking exe with core_adapter.dll.

PiperOrigin-RevId: 452222662
This commit is contained in:
hai007
2022-05-31 23:30:05 -07:00
committed by Copybara-Service
parent b5a1359d1f
commit 412e97a40a
2 changed files with 25 additions and 3 deletions
+18 -2
View File
@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include <string>
#include "connections/clients/windows/strategy_w.h"
#include <string>
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; }
+7 -1
View File
@@ -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);