Esempio n. 1
0
void Backend::writeJSON(JsonWriter& json) const
{
	json.beginObject()
		.name("name")(name_)
		.name("capacity")(capacity_)
		.name("terminate-protection")(terminateProtection_)
		.name("enabled")(enabled_)
		.name("protocol")(protocol());

	if (socketSpec_.isInet()) {
		json.name("hostname")(socketSpec_.ipaddr().str())
			.name("port")(socketSpec_.port());
	} else {
		json.name("path")(socketSpec_.local());
	}

    json.beginObject("stats");
	json.name("load")(load_);
    json.endObject();

	if (healthMonitor_) {
		json.name("health")(*healthMonitor_);
	}

	if (jsonWriteCallback_)
		jsonWriteCallback_(this, json);

	json.endObject();
}
Esempio n. 2
0
 void toJson( JsonWriter &json, const _T & v ) const
 {
     json.startObject();
     writeField<double>( json, width_s, "width", v.width );
     writeField<double>( json, height_s, "height", v.height );
     json.endObject();
 }
Esempio n. 3
0
 void toJson( JsonWriter &json, const _T & v ) const
 {
     switch( v.d() )
     {
         case ADL::picture::Picture::CIRCLE: json.startObject(); writeField( json, circle_s(), "circle", v.circle() ); json.endObject(); break;
         case ADL::picture::Picture::RECTANGLE: json.startObject(); writeField( json, rectangle_s(), "rectangle", v.rectangle() ); json.endObject(); break;
         case ADL::picture::Picture::COMPOSED: json.startObject(); writeField( json, composed_s(), "composed", v.composed() ); json.endObject(); break;
         case ADL::picture::Picture::TRANSLATED: json.startObject(); writeField( json, translated_s(), "translated", v.translated() ); json.endObject(); break;
     }
 }
Esempio n. 4
0
 void toJson( JsonWriter &json, const _T & v ) const
 {
     json.startObject();
     writeField<double>( json, radius_s, "radius", v.radius );
     json.endObject();
 }