Dictionary<string, object> dict = new Dictionary<string, object>(); dict.Add("Time", "2015-11-21 21:34:34.881"); dict.Add("Risk", "Medium"); Dictionary<string, object> msgpackOptions = new Dictionary<string, object>(); msgpackOptions.Add("TimeFormat", "DateTime"); object[] item = new object[] { DateTime.UtcNow, dict }; object[] obj = new object[] { "TestName" , new object[] { item }, msgpackOptions }; //Using MessagePackSerializer class in c# to perform the serialization byte[] message = MessagePackSerializer.Serialize(obj); //writing to a pipe client(using PipeControl class in c#, not elaborated here, since I don't really need help with this, but just want to mention end goal of serilaizing using fluentd and writing to the pipe) pipeClient.Write(message, 0, message.Length);Here is what I have implemented, but I am confused about line 11 and which data structure would be best for this. Below is my code in c++, I am using msgpack library from https://www.nuget.org/packages/msgpack-c/ to send packets after serializing(which is done by msgpack::pack function)
typedef std::map<std::string, std::string> dicts; dicts dict; dict["Time"] = "2015-11-21 21:34:34.881"; dict["Risk"] = "Medium"; typedef std::map<std::string, dicts> dictionary; dictionary item; item["2020"] = dict; //this "2020", should be the current datetime format... typedef std::map<std::string, dictionary> final; final obj; obj["TestName"]=item; msgpack::sbuffer buffer; msgpack::pack(buffer,obj);If any more information is needed, happy to provide that incase I have missed out anything.Just need some guidance/tips as to what can I do here.Also, if there is a way to see the serialized data in c# that would be very helpful. Thanks :)
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE