boost::variant claims that it is a value type. Does this mean that it's safe to simply write out the raw representation of a boost::variant and load it back later, as long as it only contains POD types? Assume that it will be reloaded by code compiled by the same compiler, and same version of boost, on the same architecture.
Also, (prob...
Hi,
I have a situation where I need to serialize an object but don't want to serialize any of its references. This is because I don't know in advance which dlls the object might be referencing and therefore can't ensure that they are serializable objects. This has arisen from needing to serialise plugins to preserve their state.
Am I r...
I have a class that is serializing very nicely - finally!
Now I want to add a property to this class, that I don't want to be serialized at all.
Is it possible to add this new property with some kind of attribute so that when I call serialize or deserialize methods, this property will go unnoticed?
Thank you
...
I have the following xml snippet:
<Configuration>
<Config name="SendToAddresses"></Config>
<Config name="CCToAddresses"></Config>
<Config name="BCCAddresses"></Config>
</Configuration>
What I would like is to deSerialize to a strongly typed class, with all items of config in an array containing value pair (name|value).
T...
I'm serialising some object using YAML::dump(). Unfortunately that includes some elements that shouldn't be serialised, like locks with waiting threads sometimes.
Is there any way to exclude selected types from serialisation, or force them to be serialised as an empty object instead?
...
A co-worker ran into an interesting issue today, and while I think the actual, big-picture answer is "the fact that we're having this problem means we're doing something wrong", I figured I'd ask this anyway.
Given the following:
public class CrazyEnumTest {
public class EnumeratedThing<T extends Enum<T>> {
public T myValue;
...
I'm writing a plug-in for an application where I have a custom class that attributes the native objects of the program. The API allows me to read and write keyed strings directly to and from the objects in the native file. So rather then reading and writing to private fields in the Get and Set accessors of each property I'm reading and w...
Hi there,
can anyone suggest the best way to serialize data (a class actually) to a DB?
I am using SQL server 2008 but i presume i need to serialize the class to a string / or other data type before storing in the database?
I presume that this field needs to be text or binary??
Does SQL server 2008 (or .net 3.5) support serializing d...
This morning my boss and I had a long and ultimately fruitless discussion about this, in the context of trying to diagnose performance problems with a web application. We didn't really come to any conclusions.
I think we're right in thinking that Serializable non-static inner classes have issues, but we're not sure precisely what the i...
We have an interesting setup where we have SqlTransactions persisted to Application memory on a web application. We're looking into moving our web application into an NLB scenario, so we need a way for those Transactions to not be tied to a single machine's memory. Is there any way we can accomplish this..I've tried serializing a SqlTran...
Hello everyone. I'm wrestling to deserialize the following XML:
<?xml version="1.0" encoding="utf-8" ?>
<conf name="settings">
<item name="lorem"
one="the"
two="quick"
three="brown"
four="fox"
five="jumps"
six="over"
seven="the"
eight="lazy"
nine="dog"
/>
<item name="ipsum"
...
The simple class below inherits from HashSet and thus has to implement the ISerialization members (in a non standard way). I get the following Exception when I try to serialize then deserialize an instance of Group:
Test method
UtilitiesTests.GroupTest.SerializeTest
threw exception:
System.Reflection.TargetInvocationException:...
I have class SomeClass with properties. For example id and name:
class SomeClass(object):
def __init__(self):
self.__id = None
self.__name = None
def get_id(self):
return self.__id
def set_id(self, value):
self.__id = value
def get_name(self):
return self.__name
def set_nam...
One of my [DataContract] classes contains a [DataMember] which is a List. BaseClass has a few different sub-classes.
Whenever that List contains instances of any sub-class, an exception occurs during/after the Service is returning to the request channel. If the List does not contain any sub-classes, it works fine.
Here is an example of...
Is it possible to serialize an ASP.NET web form, including all data that a user has entered? I want to give the users the ability to save a half-completed form and was hoping I could accomplish this with serialization. Any simple examples would be greatly appreciated.
Edit:
I want to avoid having to have separate data layer for the "i...
hi,
i have a static dicitionary in my class which hold 12000 values. when i try to save my class i need to refresh the static dictionary, i mean i need to add some data in Static Dicitionary at server side. the problem is that after adding the values into Static Dicitionary ,it still retains 12000 values, not 12001(the last one doesn't ...
Hi,
I have a static generic dictionary in a class. As static memeber cannot serialized so i have implented ISerializable interface and method GetObjectData to serialize. I have a constructor which will also accept SerializationInfo and StreamingContext to deserliaze the dictionay. Now when i try to serialize and deserialize , it always...
I have a WCF service exposed with a webHttpBinding endpoint.
[OperationContract(IsOneWay = true)]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "/?action=DoSomething&v1={value1}&v2={value2}")]
void DoSomething(string value1, string value2, MySimpleObject ...
When I parse a DateTime to json in .Net it returns a string (i.e. "\/Date(1249335194272)\/"). How do I make it return a js Date object constructor not wrap in a string?
// js server code
var dteNow = <%= jsonDateNow %>;
// js rendered code
var dteNow = "\/Date(1249335477787)\/";
// C#
using System;
using System.Collections.Generic;
...
I'm having a problem with setting up a WCF web service integration with a 3rd party. It appears that it's not correctly deserializing the response object, I'm just getting a null from the web service call.
The 3rd party is using this web service framework, which has a large set of abstract and complex types for performing simple operat...