Exemple #1
0
void
Array::Serialise(TextWriter &writer, int indent) const
{
  writer.Write('[');
  if (indent >= 0)
    writer.NewLine();

  for (auto it = children.begin(), end = children.end(); it != end;) {
    if (indent >= 0) {
      SerialiseIndent(writer, indent + 1);
      (*it)->Serialise(writer, indent + 1);

      if (++it != end)
        writer.Write(',');

      writer.NewLine();
    } else {
      (*it)->Serialise(writer, indent);

      if (++it != end)
        writer.Write(',');
    }
  }

  if (indent >= 0)
    SerialiseIndent(writer, indent);

  writer.Write(']');
}
Exemple #2
0
void
Object::Serialise(TextWriter &writer, int indent) const
{
  writer.Write('{');
  if (indent >= 0)
    writer.NewLine();

  for (auto it = children.begin(), end = children.end(); it != end;) {
    if (indent >= 0) {
      SerialiseIndent(writer, indent + 1);
      writer.Format("\"%s\": ", it->first.c_str());
      it->second->Serialise(writer, indent + 1);
      if (++it != end)
        writer.Write(',');
      writer.NewLine();
    } else {
      writer.Format("\"%s\":", it->first.c_str());
      it->second->Serialise(writer, indent);
      if (++it != end)
        writer.Write(',');
    }
  }

  if (indent >= 0)
    SerialiseIndent(writer, indent);

  writer.Write('}');
}
void InvokeContainerApiRequest::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("ActivateContainerRequest { ");
    w.Write("ApiExecArgs = {0}", apiExecArgs_);
    w.Write("TimeoutTicks = {0}", timeoutTicks_);
    w.Write("}");
}
void TestMultiPackageHostContext::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("TestMultiPackageHostContext { ");
    w.Write("NodeId = {0}, ", nodeId_);
    w.Write("HostId = {0}, ", hostId_);
    w.Write("}");
}
void RegisterContainerActivatorServiceRequest::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("RegisterContainerActivatorServiceRequest { ");
    w.Write("ProcessId = {0}", processId_);
    w.Write("ListenAddress = {0}", listenAddress_);
    w.Write("}");
}
        void WriteTo(TextWriter& w, FormatOptions const&) const
        {
            // Keep strong references for tracing outside the 
            // lock since these may the last references and when 
            // they release, the OnReleaseReference() callback will 
            // be executed, acquiring the lock again.
            //
            unordered_map<uint64, ComponentRootSPtr> referencesCopy;
            {
                AcquireReadLock lock(lock_);

                for (auto const & reference : references_)
                {
                    auto sptr = reference.second.lock();

                    if (sptr.get() != nullptr)
                    {
                        referencesCopy[reference.first] = sptr;
                    }
                }
            }
                
            w.Write("count={0}\n", referencesCopy.size());

            for (auto const & reference : referencesCopy)
            {
                w.Write(*(reference.second));
            }
        }
void PackageSharingPolicyDescription::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("PackageSharingPolicyDescription { ");
    w.Write("PackageRef = {0}, ", PackageRef);
    w.Write("Scope = {0},", Scope);
    w.Write("}");
}
void FabricHostOperationReply::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("FabricHostOperationReply { ");
    w.Write("Error = {0}", error_);
    w.Write("Error message = {0}", errorMessage_);
    w.Write("Data = {0}", data_);
    w.Write("}");
}
void UpdateCodePackageContextRequest::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("UpdateCodePackageContextRequest { ");
    w.Write("CodeContext = {0}, ", CodeContext);
    w.Write("ActivationId = {0}, ", ActivationId);
    w.Write("Timeout = {0}, ", Timeout);
    w.Write("}");
}
void SecurityAccessPolicyDescription::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("SecurityAccessPolicyDescription { ");
    w.Write("ResourceRef = {0}, ", ResourceRef);
    w.Write("PrincipalRef = {0}, ", PrincipalRef);
    w.Write("Rights = {0}", Rights);
    w.Write("}");
}
void DeactivateCodePackageRequest::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("DeactivateCodePackageRequest { ");
    w.Write("CodePackageInstanceId = {0}, ", codePackageInstanceId_);
    w.Write("ActivationId = {0}, ", ActivationId);
    w.Write("Timeout = {0}, ", Timeout);
    w.Write("}");
}
void SharableProxy::RecordVector::WriteTo(TextWriter& w, FormatOptions const&) const
{
    w.Write("{0}\r\n", instance_);

    for (ArbitrationRecord const & record : records_)
    {
        w.Write("{0}:{1}\r\n", record.Monitor, record.ExpireTime);
    }
}
void LogConfigDescription::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("LogConfigDescription { ");
    w.Write("Driver = {0}, ", Driver);
    w.Write("DriverOpts {");
    for (auto i = 0; i < DriverOpts.size(); i++)
    {
        w.Write("DriverOpt = {0}", DriverOpts[i]);
    }
 
    w.Write("}");
}
void DllHostEntryPointDescription::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("DllHostEntryPointDescription { ");
    w.Write("IsolationPolicyType = {0}, ", IsolationPolicyType);    
    w.Write("Items = {");
    
    for (auto it = begin(HostedDlls); it != end(HostedDlls); ++it)
    {
        w.Write("{0}", *it);
    }

    w.Write("}");
}
Exemple #15
0
void
WriteCup(TextWriter &writer, const Waypoint &wp)
{
  // Write Title
  writer.Format(_T("\"%s\","), wp.name.c_str());

  // Write Code
  writer.Write(',');

  // Write Country
  writer.Write(',');

  // Write Latitude
  WriteAngleDMM(writer, wp.location.latitude, true);
  writer.Write(',');

  // Write Longitude
  WriteAngleDMM(writer, wp.location.longitude, false);
  writer.Write(',');

  // Write Elevation
  WriteAltitude(writer, wp.elevation);
  writer.Write(',');

  // Write Style
  WriteSeeYouFlags(writer, wp);
  writer.Write(',');

  // Write Runway Direction
  if ((wp.type == Waypoint::Type::AIRFIELD ||
       wp.type == Waypoint::Type::OUTLANDING) &&
      wp.runway.IsDirectionDefined())
    writer.Format("%03u", wp.runway.GetDirectionDegrees());

  writer.Write(',');

  // Write Runway Length
  if ((wp.type == Waypoint::Type::AIRFIELD ||
       wp.type == Waypoint::Type::OUTLANDING) &&
      wp.runway.IsLengthDefined())
    writer.Format("%03uM", wp.runway.GetLength());

  writer.Write(',');

  // Write Airport Frequency
  if (wp.radio_frequency.IsDefined()) {
    const unsigned freq = wp.radio_frequency.GetKiloHertz();
    writer.Format("\"%u.%03u\"", freq / 1000, freq % 1000);
  }

  writer.Write(',');

  // Write Description
  writer.FormatLine(_T("\"%s\""), wp.comment.c_str());
}
void DllHostHostedDllDescription::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("DllHostHostedDllDescription { ");
    w.Write("Kind = {0}, ", Kind);
    switch (this->Kind)
    {
    case DllHostHostedDllKind::Unmanaged :
        w.Write(this->Unmanaged);
        break;
    case DllHostHostedDllKind::Managed :
        w.Write(this->Managed);
        break;
    }
    w.Write("}");
}
 void WriteTo(TextWriter& w, FormatOptions const&) const override
 {
     w.Write("[id={0}, utc={1}] stack='{2}'", 
         id_, 
         timestamp_,
         stack_);
 }
Exemple #18
0
void
GRecord::WriteTo(TextWriter &writer) const
{
  char digest[DIGEST_LENGTH + 1];
  GetDigest(digest);

  static constexpr size_t chars_per_line = 16;
  static_assert(DIGEST_LENGTH % chars_per_line == 0, "wrong digest length");

  for (const char *i = digest, *end = digest + DIGEST_LENGTH;
       i != end; i += chars_per_line) {
    writer.Write('G');
    writer.Write(i, chars_per_line);
    writer.NewLine();
  }
}
void X509IdentitySet::WriteTo(TextWriter & w, FormatOptions const &) const
{
    bool outputGenerated = false;
    for (auto const & id : set_)
    {
        if (outputGenerated)
        {
            w.Write(",{0}", id);
        }
        else
        {
            w.Write("{0}", id);
            outputGenerated = true;
        }
    }
}
Exemple #20
0
static void
WriteAngleDMM(TextWriter &writer, const Angle angle, bool is_latitude)
{
  // Calculate degrees, minutes and decimal minutes
  unsigned deg, min, mmm;
  bool is_positive;
  angle.ToDMM(deg, min, mmm, is_positive);

  // Save them into the buffer string
  writer.Format(is_latitude ? "%02u%02u.%03u" : "%03u%02u.%03u",
                deg, min, mmm);

  // Attach the buffer string to the output
  if (is_latitude)
    writer.Write(is_positive ? "N" : "S");
  else
    writer.Write(is_positive ? "E" : "W");
}
void CodePackageDescription::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("CodePackageDescription { ");
    w.Write("Name = {0}, ", Name);
    w.Write("Version = {0}, ", Version);
    w.Write("IsShared = {0}, ", IsShared);
    w.Write("HasSetupEntryPoint = {0}, ", HasSetupEntryPoint);
    w.Write("SetupEntryPoint = {0}, ", SetupEntryPoint);
    w.Write("EntryPoint = {0}, ", EntryPoint);
    w.Write("}");
}
void ApplicationHostClosedEventArgs::WriteTo(TextWriter& w, FormatOptions const&) const
{
    w.Write("ApplicationHostClosedEventArgs { ");
    w.Write("SequenceNumber = {0}, ", SequenceNumber);
    w.Write("HostId = {0},", HostId);
    w.Write("ServiceTypes = [");
    for(auto iter = serviceTypes_.cbegin(); iter != serviceTypes_.cend(); ++iter)
    {
        w.Write("{0},", iter->ServiceTypeName);
    }
    w.Write("],");
    w.Write("ActivaionContext = {0}", activationContext_);
    w.Write("ServicePackagePublicActivationId = {0}", servicePackagePublicActivationId_);
    w.Write("}");
}
void UploadSessionMetadata::WriteTo(TextWriter & w, FormatOptions const &) const
{    
    std::string builder = "[ ";
    for (std::vector<UploadChunk>::const_iterator it = this->receivedChunks_.begin(); it != this->receivedChunks_.end(); ++it)
    {
        builder.append(Common::formatString("{0}-{1} ", std::to_string(it->StartPosition), std::to_string(it->EndPosition)));
    }

    builder.append("]");
    w.Write("UploadSessionMetadata[{0}, {1}, {2}, {3}]", storeRelativePath_, fileSize_, builder, lastModifiedTime_.ToString());
}
void RollingUpgradeMonitoringPolicy::WriteTo(TextWriter& w, FormatOptions const &) const
{
    w.Write(
        "action:{0}, wait:{1}, stable:{2}, retry:{3}, ud:{4}, overall:{5}", 
        failureAction_, 
        healthCheckWaitDuration_, 
        healthCheckStableDuration_, 
        healthCheckRetryTimeout_, 
        upgradeDomainTimeout_, 
        upgradeTimeout_);
}
void ApplicationHostEvent::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("ApplicationHostEvent { ");
    w.Write("CodePackageInstanceIdentifier = {0}", codePackageInstanceIdentifier_);
    w.Write("ApplicationName = {0}", appName_);
    w.Write("MetadataInformation = {0}", appHostId_);
    w.Write("HostType = {0}", hostType_);
    w.Write("IsUp = {0}", isUp_);
    w.Write("}");
}
void ContainerApiExecutionArgs::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("ContainerApiExecutionArgs { ");
    w.Write("ContainerName = {0}", ContainerName);
    w.Write("HttpVerb = {0}", HttpVerb);
    w.Write("UriPath = {0}", UriPath);
    w.Write("ContentType = {0}, ", ContentType);
    w.Write("RequestBody = {0}", RequestBody);
    w.Write("}");
}
void ComposeDeploymentContext::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write(
        "ComposeDeploymentContext({0})[{1}, {2}, {3}, ({4}) ({5}, {6})]",
        this->Status,
        deploymentName_,
        applicationName_,
        applicationId_,
        globalInstanceCount_,
        appTypeName_,
        appTypeVersion_);
}
void StartRegisterApplicationHostRequest::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("StartRegisterApplicationHostRequest { ");
    w.Write("Id = {0}, ", Id);
    w.Write("Type = {0}, ", Type);
    w.Write("ProcessId = {0}, ", ProcessId);
    w.Write("IsContainerHost = {0}, ", IsContainerHost);
    w.Write("Timeout = {0}", Timeout);
    w.Write("}");
}
Exemple #29
0
void Replica::WriteTo(TextWriter& writer, FormatOptions const&) const
{
    writer.Write(
        "{0} {1} {2}:{3} {4} {5} {6}/{7}",
        GetStateString(),
        FederationNodeInstance,
        ReplicaId,
        InstanceId,
        serviceUpdateVersion_,
        VersionInstance,
        lastUpDownTime_,
        LastUpdated);
}
void StartUpgradeDescription::WriteTo(TextWriter & w, FormatOptions const &) const
{
    w.Write("ClusterConfig: {0}, healthCheckRetryTimeout: {1}, healthCheckWaitDuration: {2}, healthCheckStableDuration: {3}, upgradeDomainTimeout: {4}, upgradeTimeout: {5}, maxPercentUnhealthyApplications: {6}, maxPercentUnhealthyNodes: {7}, maxPercentDeltaUnhealthyNodes: {8}, maxPercentUpgradeDomainDeltaUnhealthyNodes: {9}",
        clusterConfig_,
        healthCheckRetryTimeout_,
        healthCheckWaitDuration_,
        healthCheckStableDuration_,
        upgradeDomainTimeout_,
        upgradeTimeout_,
        maxPercentUnhealthyApplications_,
        maxPercentUnhealthyNodes_,
        maxPercentDeltaUnhealthyNodes_,
        maxPercentUpgradeDomainDeltaUnhealthyNodes_);
}