本文整理汇总了C#中DDS.GetLivelinessChangedStatus方法的典型用法代码示例。如果您正苦于以下问题:C# DDS.GetLivelinessChangedStatus方法的具体用法?C# DDS.GetLivelinessChangedStatus怎么用?C# DDS.GetLivelinessChangedStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DDS
的用法示例。
在下文中一共展示了DDS.GetLivelinessChangedStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LivelinessChangedValid
public static bool LivelinessChangedValid(DDS.IDataReader reader, int activeCount,
int activeCountChange, int inactiveCount, int inactiveCountChange)
{
bool result = false;
DDS.LivelinessChangedStatus holder = new DDS.LivelinessChangedStatus();
DDS.ReturnCode rc = reader.GetLivelinessChangedStatus(ref holder);
if (rc == DDS.ReturnCode.Ok)
{
DDS.LivelinessChangedStatus status = holder;
if (status.AliveCount == activeCount)
{
if (status.AliveCountChange == activeCountChange)
{
if (status.NotAliveCount == inactiveCount)
{
if (status.NotAliveCountChange == inactiveCountChange)
{
result = true;
}
else
{
System.Console.Error.WriteLine("liveliness_change.not_alive_count_change != '" +
inactiveCountChange + "', but '" + status.NotAliveCountChange + "'.");
}
}
else
{
System.Console.Error.WriteLine("liveliness_change.not_alive_count != '" + inactiveCount
+ "', but '" + status.NotAliveCount + "'.");
}
}
else
{
System.Console.Error.WriteLine("liveliness_change.AliveCountChange != '" + activeCountChange
+ "', but '" + status.AliveCountChange + "'.");
}
}
else
{
System.Console.Error.WriteLine("liveliness_change.AliveCount != '" + activeCount
+ "', but '" + status.AliveCount + "'.");
}
}
else
{
System.Console.Error.WriteLine("get_liveliness_changed_status returned " + rc);
}
return result;
}
示例2: PrintStatusses
private void PrintStatusses(DDS.IDataReader reader)
{
DDS.ReturnCode rc;
DDS.RequestedDeadlineMissedStatus rdmsHolder = new DDS.RequestedDeadlineMissedStatus();
rc = reader.GetRequestedDeadlineMissedStatus(ref rdmsHolder);
DDS.RequestedDeadlineMissedStatus rdms = rdmsHolder;
if (rc != DDS.ReturnCode.Ok)
{
System.Console.Error.WriteLine("Unable to resolve status!");
return;
}
DDS.RequestedIncompatibleQosStatus riqsHolder = new DDS.RequestedIncompatibleQosStatus();
rc = reader.GetRequestedIncompatibleQosStatus(ref riqsHolder);
DDS.RequestedIncompatibleQosStatus riqs = riqsHolder;
if (rc != DDS.ReturnCode.Ok)
{
System.Console.Error.WriteLine("Unable to resolve status!");
return;
}
DDS.SampleRejectedStatus srsHolder = new DDS.SampleRejectedStatus();
rc = reader.GetSampleRejectedStatus(ref srsHolder);
DDS.SampleRejectedStatus srs = srsHolder;
if (rc != DDS.ReturnCode.Ok)
{
System.Console.Error.WriteLine("Unable to resolve status!");
return;
}
DDS.LivelinessChangedStatus lcsHolder = new DDS.LivelinessChangedStatus();
rc = reader.GetLivelinessChangedStatus(ref lcsHolder);
DDS.LivelinessChangedStatus lcs = lcsHolder;
if (rc != DDS.ReturnCode.Ok)
{
System.Console.Error.WriteLine("Unable to resolve status!");
return;
}
DDS.SubscriptionMatchedStatus smsHolder = new DDS.SubscriptionMatchedStatus();
rc = reader.GetSubscriptionMatchedStatus(ref smsHolder);
DDS.SubscriptionMatchedStatus sms = smsHolder;
if (rc != DDS.ReturnCode.Ok)
{
System.Console.Error.WriteLine("Unable to resolve status!");
return;
}
DDS.SampleLostStatus slsHolder = new DDS.SampleLostStatus();
rc = reader.GetSampleLostStatus(ref slsHolder);
DDS.SampleLostStatus sls = slsHolder;
if (rc != DDS.ReturnCode.Ok)
{
System.Console.Error.WriteLine("Unable to resolve status!");
return;
}
System.Console.Out.WriteLine("requested_deadline_missed.TotalCount : " +
rdms.TotalCount);
System.Console.Out.WriteLine("requested_deadline_missed.TotalCountChange : " +
rdms.TotalCountChange);
System.Console.Out.WriteLine("requested_deadline_missed.LastInstanceHandle: " +
rdms.LastInstanceHandle);
System.Console.Out.WriteLine("requested_incompatible_qos.TotalCount : " +
riqs.TotalCount);
System.Console.Out.WriteLine("requested_incompatible_qos.TotalCountChange : " +
riqs.TotalCountChange);
System.Console.Out.WriteLine("requested_incompatible_qos.LastPolicyId : " +
riqs.LastPolicyId);
System.Console.Out.WriteLine("sample_rejected.TotalCount : " +
srs.TotalCount);
System.Console.Out.WriteLine("sample_rejected.TotalCountChange : " +
srs.TotalCountChange);
System.Console.Out.WriteLine("sample_rejected.LastInstanceHandle : " +
srs.LastInstanceHandle);
System.Console.Out.WriteLine("liveliness_changed.AliveCount : " +
lcs.AliveCount);
System.Console.Out.WriteLine("liveliness_changed.AliveCountChange : " +
lcs.AliveCountChange);
System.Console.Out.WriteLine("liveliness_changed.not_alive_count : " +
lcs.NotAliveCount);
System.Console.Out.WriteLine("liveliness_changed.not_alive_count_change : " +
lcs.NotAliveCountChange);
System.Console.Out.WriteLine("subscription_match.TotalCount : " +
sms.TotalCount);
System.Console.Out.WriteLine("subscription_match.TotalCountChange : " +
sms.TotalCountChange);
System.Console.Out.WriteLine("subscription_match.last_publication_handle : " +
sms.LastPublicationHandle);
System.Console.Out.WriteLine("sample_lost.TotalCount : " +
sls.TotalCount);
System.Console.Out.WriteLine("sample_lost.TotalCountChange : " +
sls.TotalCountChange + "\n");
}