Example #1
0
        public static IIdSystem NewInstance(LocalObjectContainer localContainer)
        {
            var systemData   = localContainer.SystemData();
            var idSystemType = systemData.IdSystemType();

            switch (idSystemType)
            {
            case Legacy:
            {
                return(new PointerBasedIdSystem(localContainer));
            }

            case PointerBased:
            {
                return(new PointerBasedIdSystem(localContainer));
            }

            case StackedBtree:
            {
                var inMemoryIdSystem = new InMemoryIdSystem(localContainer);
                var bTreeIdSystem    = new BTreeIdSystem(localContainer, inMemoryIdSystem);
                systemData.FreespaceIdSystem(bTreeIdSystem.FreespaceIdSystem());
                return(new BTreeIdSystem(localContainer, bTreeIdSystem));
            }

            case SingleBtree:
            {
                var smallInMemoryIdSystem = new InMemoryIdSystem(localContainer);
                var smallBTreeIdSystem    = new BTreeIdSystem(localContainer, smallInMemoryIdSystem
                                                              );
                systemData.FreespaceIdSystem(smallBTreeIdSystem.FreespaceIdSystem());
                return(smallBTreeIdSystem);
            }

            case InMemory:
            {
                return(new InMemoryIdSystem(localContainer));
            }

            case Custom:
            {
                var customIdSystemFactory = localContainer.ConfigImpl.CustomIdSystemFactory
                                                ();
                if (customIdSystemFactory == null)
                {
                    throw new Db4oFatalException(
                              "Custom IdSystem configured but no factory was found. See IdSystemConfiguration#useCustomSystem()"
                              );
                }
                return(customIdSystemFactory.NewInstance(localContainer));
            }

            default:
            {
                return(new PointerBasedIdSystem(localContainer));

                break;
            }
            }
        }
Example #2
0
        public static IIdSystem NewInstance(LocalObjectContainer localContainer)
        {
            var systemData = localContainer.SystemData();
            var idSystemType = systemData.IdSystemType();
            switch (idSystemType)
            {
                case Legacy:
                {
                    return new PointerBasedIdSystem(localContainer);
                }

                case PointerBased:
                {
                    return new PointerBasedIdSystem(localContainer);
                }

                case StackedBtree:
                {
                    var inMemoryIdSystem = new InMemoryIdSystem(localContainer);
                    var bTreeIdSystem = new BTreeIdSystem(localContainer, inMemoryIdSystem);
                    systemData.FreespaceIdSystem(bTreeIdSystem.FreespaceIdSystem());
                    return new BTreeIdSystem(localContainer, bTreeIdSystem);
                }

                case SingleBtree:
                {
                    var smallInMemoryIdSystem = new InMemoryIdSystem(localContainer);
                    var smallBTreeIdSystem = new BTreeIdSystem(localContainer, smallInMemoryIdSystem
                        );
                    systemData.FreespaceIdSystem(smallBTreeIdSystem.FreespaceIdSystem());
                    return smallBTreeIdSystem;
                }

                case InMemory:
                {
                    return new InMemoryIdSystem(localContainer);
                }

                case Custom:
                {
                    var customIdSystemFactory = localContainer.ConfigImpl.CustomIdSystemFactory
                        ();
                    if (customIdSystemFactory == null)
                    {
                        throw new Db4oFatalException(
                            "Custom IdSystem configured but no factory was found. See IdSystemConfiguration#useCustomSystem()"
                            );
                    }
                    return customIdSystemFactory.NewInstance(localContainer);
                }

                default:
                {
                    return new PointerBasedIdSystem(localContainer);
                    break;
                }
            }
        }
Example #3
0
 public _IFunction4_32(InMemoryIdSystem _enclosing, int maxValidId)
 {
     this._enclosing = _enclosing;
     this.maxValidId = maxValidId;
 }
Example #4
0
 public _IVisitor4_233(InMemoryIdSystem _enclosing)
 {
     this._enclosing = _enclosing;
 }
Example #5
0
			public _IVisitor4_69(InMemoryIdSystem _enclosing)
			{
				this._enclosing = _enclosing;
			}
Example #6
0
			public _IFunction4_32(InMemoryIdSystem _enclosing, int maxValidId)
			{
				this._enclosing = _enclosing;
				this.maxValidId = maxValidId;
			}