예제 #1
0
 public _IClosure4_333(GenericReflector _enclosing, int id, IGenericConverter converter
                       , string name)
 {
     this._enclosing = _enclosing;
     this.id         = id;
     this.converter  = converter;
     this.name       = name;
 }
예제 #2
0
		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) };
		}
예제 #3
0
		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();
		}
예제 #4
0
 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();
 }
예제 #5
0
		/// <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;
		}
예제 #6
0
 /// <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);
 }
예제 #7
0
		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;
		}
예제 #8
0
        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);
        }
예제 #9
0
 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);
 }
예제 #10
0
 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;
		}
예제 #12
0
 public _IClosure4_190(GenericReflector _enclosing, string className)
 {
     this._enclosing = _enclosing;
     this.className = className;
 }
예제 #13
0
		public GenericArrayClass(GenericReflector reflector, IReflectClass delegateClass, 
			string name, GenericClass superclass) : base(reflector, delegateClass, name, superclass
			)
		{
		}
예제 #14
0
 public GenericClassBuilder(GenericReflector reflector, IReflector delegate_) : base
         ()
 {
     _reflector = reflector;
     _delegate  = delegate_;
 }
예제 #15
0
 public GenericArrayReflector(GenericReflector reflector)
 {
     _delegate = reflector.GetDelegate().Array();
 }
예제 #16
0
 public GenericArrayClass(GenericReflector reflector, IReflectClass delegateClass,
                          string name, GenericClass superclass) : base(reflector, delegateClass, name, superclass
                                                                       )
 {
 }
예제 #17
0
 public _IClosure4_303(GenericReflector _enclosing, GenericClass
     clazz)
 {
     this._enclosing = _enclosing;
     this.clazz = clazz;
 }
예제 #18
0
		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);
		}
예제 #19
0
			public _IClosure4_303(GenericReflector _enclosing, Db4objects.Db4o.Reflect.Generic.GenericClass
				 clazz)
			{
				this._enclosing = _enclosing;
				this.clazz = clazz;
			}
예제 #20
0
 public _IClosure4_319(GenericReflector _enclosing)
 {
     this._enclosing = _enclosing;
 }
예제 #21
0
 public _IClosure4_333(GenericReflector _enclosing, int id, IGenericConverter converter
     , string name)
 {
     this._enclosing = _enclosing;
     this.id = id;
     this.converter = converter;
     this.name = name;
 }
예제 #22
0
 public _IClosure4_190(GenericReflector _enclosing, string className)
 {
     this._enclosing = _enclosing;
     this.className  = className;
 }
예제 #23
0
 /// <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;
 }
예제 #24
0
		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;
		}
예제 #25
0
		public GenericClassBuilder(GenericReflector reflector, IReflector delegate_) : base
			()
		{
			_reflector = reflector;
			_delegate = delegate_;
		}
예제 #26
0
 public _IClosure4_303(GenericReflector _enclosing, Db4objects.Db4o.Reflect.Generic.GenericClass
                       clazz)
 {
     this._enclosing = _enclosing;
     this.clazz      = clazz;
 }
예제 #27
0
		public GenericArrayReflector(GenericReflector reflector)
		{
			_delegate = reflector.GetDelegate().Array();
		}
예제 #28
0
파일: Platform4.cs 프로젝트: superyfwy/db4o
        public static void RegisterCollections(GenericReflector reflector)
        {
//            reflector.RegisterCollectionUpdateDepth(
//                typeof(IDictionary),
//                3);
        }
예제 #29
0
 public _IClosure4_319(GenericReflector _enclosing)
 {
     this._enclosing = _enclosing;
 }