public _IClosure4_333(GenericReflector _enclosing, int id, IGenericConverter converter , string name) { this._enclosing = _enclosing; this.id = id; this.converter = converter; this.name = name; }
private GenericField[] Fields(GenericClass personClass, GenericReflector reflector ) { return new GenericField[] { new GenericField("surname", reflector.ForClass(typeof( string)), false), new GenericField("birthdate", reflector.ForClass(typeof(DateTime )), false), new GenericField("bestFriend", personClass, false), new GenericField ("nArray", reflector.ForClass(typeof(int[][])), true) }; }
public GenericClass(GenericReflector reflector, IReflectClass delegateClass, string name, Db4objects.Db4o.Reflect.Generic.GenericClass superclass) { _reflector = reflector; _delegate = delegateClass; _name = name; _superclass = superclass; _hashCode = _name.GetHashCode(); }
/// <summary>todo: Move the GenericClass creation into a utility/factory class.</summary> /// <remarks>todo: Move the GenericClass creation into a utility/factory class.</remarks> /// <returns></returns> public virtual GenericClass InitGenericClass() { GenericReflector reflector = new GenericReflector(null, Platform4.ReflectorForType (typeof(GenericObjectsTest))); GenericClass _objectIClass = (GenericClass)reflector.ForClass(typeof(object)); GenericClass result = new GenericClass(reflector, null, PersonClassname, _objectIClass ); result.InitFields(Fields(result, reflector)); return result; }
/// <summary>Creates a clone of provided object</summary> /// <param name="obj">object to copy</param> /// <returns>copy of the submitted object</returns> public virtual object DeepClone(object obj) { Db4objects.Db4o.Reflect.Generic.GenericReflector myClone = new Db4objects.Db4o.Reflect.Generic.GenericReflector (null, (IReflector)_delegate.DeepClone(this)); myClone._collectionPredicates = (Collection4)_collectionPredicates.DeepClone(myClone ); // Interesting, adding the following messes things up. // Keep the code, since it may make sense to carry the // global reflectors into a running db4o session. // Iterator4 i = _classes.iterator(); // while(i.hasNext()){ // GenericClass clazz = (GenericClass)i.next(); // clazz = (GenericClass)clazz.deepClone(myClone); // myClone._classByName.put(clazz.getName(), clazz); // myClone._classes.add(clazz); // } return(myClone); }
public ReplicationReflector(IReplicationProvider providerA, IReplicationProvider providerB, IReflector reflector) { if (reflector == null) { if ((_container = ContainerFrom(providerA)) != null) { return; } if ((_container = ContainerFrom(providerB)) != null) { return; } } GenericReflector genericReflector = new GenericReflector(null, reflector == null ? Platform4.ReflectorForType(typeof(Db4objects.Drs.Inside.ReplicationReflector)) : reflector); Platform4.RegisterCollections(genericReflector); _reflector = genericReflector; }
public virtual object DeepClone(object obj) { GenericReflector reflector = (GenericReflector)obj; Db4objects.Db4o.Reflect.Generic.GenericClass superClass = null; if (_superclass != null) { _superclass = (Db4objects.Db4o.Reflect.Generic.GenericClass)reflector.ForName(_superclass .GetName()); } Db4objects.Db4o.Reflect.Generic.GenericClass ret = new Db4objects.Db4o.Reflect.Generic.GenericClass (reflector, _delegate, _name, superClass); GenericField[] fields = new GenericField[_fields.Length]; for (int i = 0; i < fields.Length; i++) { fields[i] = (GenericField)_fields[i].DeepClone(reflector); } ret.InitFields(fields); return(ret); }
internal HandlerRegistry(ObjectContainerBase container, byte stringEncoding, GenericReflector reflector) { // this is the master container and not valid // for TransportObjectContainer _handlerVersions = new HandlerVersionRegistry(this); _stringIO = BuiltInStringEncoding.StringIoForEncoding(stringEncoding, container.ConfigImpl .StringEncoding()); _container = container; container._handlers = this; _reflector = reflector; _diagnosticProcessor = container.ConfigImpl.DiagnosticProcessor(); InitClassReflectors(reflector); _indexes = new SharedIndexedFields(); _virtualFields[0] = _indexes._version; _virtualFields[1] = _indexes._uUID; _virtualFields[2] = _indexes._commitTimestamp; RegisterBuiltinHandlers(); RegisterPlatformTypes(); InitArrayHandlers(); Platform4.RegisterPlatformHandlers(container); }
public _IClosure4_303(GenericReflector _enclosing, GenericClass clazz) { this._enclosing = _enclosing; this.clazz = clazz; }
public virtual GenericClass ClassMetaToGenericClass(GenericReflector reflector, ClassInfo classMeta) { if (classMeta.IsSystemClass()) { return (GenericClass)reflector.ForName(classMeta.GetClassName()); } string className = classMeta.GetClassName(); // look up from generic class table. GenericClass genericClass = LookupGenericClass(className); if (genericClass != null) { return genericClass; } IReflectClass reflectClass = reflector.ForName(className); if (reflectClass != null) { return (GenericClass)reflectClass; } GenericClass genericSuperClass = null; ClassInfo superClassMeta = classMeta.GetSuperClass(); if (superClassMeta != null) { genericSuperClass = ClassMetaToGenericClass(reflector, superClassMeta); } genericClass = new GenericClass(reflector, null, className, genericSuperClass); RegisterGenericClass(className, genericClass); FieldInfo[] fields = classMeta.GetFields(); GenericField[] genericFields = new GenericField[fields.Length]; for (int i = 0; i < fields.Length; ++i) { ClassInfo fieldClassMeta = fields[i].GetFieldClass(); string fieldName = fields[i].GetFieldName(); GenericClass genericFieldClass = ClassMetaToGenericClass(reflector, fieldClassMeta ); genericFields[i] = new GenericField(fieldName, genericFieldClass, fields[i]._isPrimitive ); } genericClass.InitFields(genericFields); return genericClass; }
public _IClosure4_190(GenericReflector _enclosing, string className) { this._enclosing = _enclosing; this.className = className; }
public GenericArrayClass(GenericReflector reflector, IReflectClass delegateClass, string name, GenericClass superclass) : base(reflector, delegateClass, name, superclass ) { }
public GenericClassBuilder(GenericReflector reflector, IReflector delegate_) : base () { _reflector = reflector; _delegate = delegate_; }
public GenericArrayReflector(GenericReflector reflector) { _delegate = reflector.GetDelegate().Array(); }
private void InitClassReflectors(GenericReflector reflector) { IclassCompare = reflector.ForClass(Const4.ClassCompare); IclassDb4otype = reflector.ForClass(Const4.ClassDb4otype); IclassDb4otypeimpl = reflector.ForClass(Const4.ClassDb4otypeimpl); IclassInternal = reflector.ForClass(Const4.ClassInternal); IclassUnversioned = reflector.ForClass(Const4.ClassUnversioned); IclassObject = reflector.ForClass(Const4.ClassObject); IclassObjectcontainer = reflector.ForClass(Const4.ClassObjectcontainer); IclassStaticclass = reflector.ForClass(Const4.ClassStaticclass); IclassString = reflector.ForClass(typeof(string)); IclassTransientclass = reflector.ForClass(Const4.ClassTransientclass); Platform4.RegisterCollections(reflector); }
public _IClosure4_303(GenericReflector _enclosing, Db4objects.Db4o.Reflect.Generic.GenericClass clazz) { this._enclosing = _enclosing; this.clazz = clazz; }
public _IClosure4_319(GenericReflector _enclosing) { this._enclosing = _enclosing; }
/// <summary>Creates a clone of provided object</summary> /// <param name="obj">object to copy</param> /// <returns>copy of the submitted object</returns> public virtual object DeepClone(object obj) { var myClone = new GenericReflector (null, (IReflector) _delegate.DeepClone(this)); myClone._collectionPredicates = (Collection4) _collectionPredicates.DeepClone(myClone ); // Interesting, adding the following messes things up. // Keep the code, since it may make sense to carry the // global reflectors into a running db4o session. // Iterator4 i = _classes.iterator(); // while(i.hasNext()){ // GenericClass clazz = (GenericClass)i.next(); // clazz = (GenericClass)clazz.deepClone(myClone); // myClone._classByName.put(clazz.getName(), clazz); // myClone._classes.add(clazz); // } return myClone; }
public GenericReflector Reflector() { GenericReflector reflector = (GenericReflector)_config.Get(ReflectorKey); if (reflector == null) { IReflector configuredReflector = (IReflector)_config.Get(ConfiguredReflectorKey); if (configuredReflector == null) { configuredReflector = Platform4.CreateReflector(ClassLoader()); _config.Put(ConfiguredReflectorKey, configuredReflector); } reflector = new GenericReflector(configuredReflector); _config.Put(ReflectorKey, reflector); } // TODO: transaction assignment has been moved to YapStreamBase#initialize1(). // implement better, more generic solution as described in COR-288 // if(! reflector.hasTransaction() && i_stream != null){ // reflector.setTransaction(i_stream.getSystemTransaction()); // } return reflector; }
public static void RegisterCollections(GenericReflector reflector) { // reflector.RegisterCollectionUpdateDepth( // typeof(IDictionary), // 3); }