本文整理汇总了C++中Domain::GetBaseType方法的典型用法代码示例。如果您正苦于以下问题:C++ Domain::GetBaseType方法的具体用法?C++ Domain::GetBaseType怎么用?C++ Domain::GetBaseType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain::GetBaseType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Enqueue
/// <summary>
/// Enqueues the specified context.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="telemetry">The telemetry.</param>
void TelemetryChannel::Enqueue(TelemetryContext &context, Domain &telemetry)
{
Data data;
data.SetBaseData(telemetry);
data.SetBaseType(telemetry.GetBaseType());
std::wstring buffer;
StringWriter content(&buffer);
JsonWriter json(content);
#ifdef WINAPI_FAMILY_PARTITION
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) // Windows phone or store
//if (TraceLoggingProviderEnabled(g_hAppInsightsProvider, 0, 0))
if(false)
{
//Assumption: UTC is available
json.WriteObjectValue(&data);
auto partB = content.ToString();
TraceLoggingWrite(
g_hAppInsightsProvider,
"Part B data",
TraceLoggingKeyword(MICROSOFT_KEYWORD_TELEMETRY),
TraceLoggingWideString(partB.c_str()));
}
else
{
#endif
#endif
Envelope envelope;
envelope.SetData(data);
envelope.SetIKey(m_config->GetIKey());
envelope.SetTime(Utils::GetCurrentDateTime());
envelope.SetName(telemetry.GetEnvelopeName());
envelope.SetSeq(std::to_wstring(m_channelId) + L":" + std::to_wstring(m_seqNum++));
wstring_wstring_map tags;
context.GetContextTags(tags);
envelope.SetTags(tags);
json.WriteObjectValue(&envelope);
m_buffer.push_back(content.ToString());
if ((int)m_buffer.size() >= m_maxBufferSize)
{
Send();
}
if (context.GetSession().GetIsNew().HasValue() && context.GetSession().GetIsNew().GetValue() == L"True")
{
Nullable<std::wstring> strFalse = std::wstring(L"False");
context.GetSession().SetIsFirst(strFalse);
context.GetSession().SetIsNew(strFalse);
}
#ifdef WINAPI_FAMILY_PARTITION
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) // Windows phone or store
}
#endif
#endif
}
示例2: Enqueue
/// <summary>
/// Enqueues the specified context.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="telemetry">The telemetry.</param>
void TelemetryChannel::Enqueue(TelemetryContext &context, Domain &telemetry)
{
Data data;
data.SetBaseData(telemetry);
data.SetBaseType(telemetry.GetBaseType());
std::wstring buffer;
StringWriter content(&buffer);
JsonWriter json(content);
Envelope envelope;
envelope.SetData(data);
envelope.SetIKey(m_config->GetIKey());
envelope.SetTime(Utils::GetCurrentDateTime());
envelope.SetName(telemetry.GetEnvelopeName());
envelope.SetSeq(std::to_wstring(m_channelId) + L":" + std::to_wstring(m_seqNum++));
wstring_wstring_map tags;
context.GetContextTags(tags);
envelope.SetTags(tags);
json.WriteObjectValue(&envelope);
m_buffer.push_back(content.ToString());
if ((int)m_buffer.size() >= m_maxBufferSize)
{
Send();
}
if (context.GetSession().GetIsNew().HasValue() && context.GetSession().GetIsNew().GetValue() == L"True")
{
Nullable<std::wstring> strFalse = std::wstring(L"False");
context.GetSession().SetIsFirst(strFalse);
context.GetSession().SetIsNew(strFalse);
}
}