本文整理汇总了C#中IProcedure4类的典型用法代码示例。如果您正苦于以下问题:C# IProcedure4类的具体用法?C# IProcedure4怎么用?C# IProcedure4使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IProcedure4类属于命名空间,在下文中一共展示了IProcedure4类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: BTreeFreespaceManager
public BTreeFreespaceManager(LocalObjectContainer file, IProcedure4 slotFreedCallback
, int discardLimit) : base(slotFreedCallback, discardLimit)
{
_file = file;
_delegate = new InMemoryFreespaceManager(slotFreedCallback, discardLimit);
_idSystem = file.SystemData().FreespaceIdSystem();
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:7,代码来源:BTreeFreespaceManager.cs
示例2: Produce
public virtual object Produce(object key, IFunction4 producer, IProcedure4 onDiscard
)
{
_calls++;
IFunction4 delegateProducer = new _IFunction4_26(this, producer);
return _delegate.Produce(key, delegateProducer, onDiscard);
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:7,代码来源:CacheStatistics.cs
示例3: Produce
public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
)
{
if (key == null)
{
throw new ArgumentNullException();
}
if (_am.Remove(key))
{
_am.AddFirst(key);
return _slots[key];
}
if (_a1.Remove(key))
{
_am.AddFirst(key);
return _slots[key];
}
if (_slots.Count >= _maxSize)
{
DiscardPage(finalizer);
}
object value = producer.Apply(key);
_slots[key] = value;
_a1.AddFirst(key);
return value;
}
开发者ID:erdincay,项目名称:db4o,代码行数:26,代码来源:LRU2QCache.cs
示例4: Produce
public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
)
{
if (key == null)
{
throw new ArgumentNullException();
}
if (_am.Remove(key))
{
_am.AddFirst(key);
return _slots[key];
}
if (_a1out.Contains(key))
{
ReclaimFor(key, producer, finalizer);
_am.AddFirst(key);
return _slots[key];
}
if (_a1in.Contains(key))
{
return _slots[key];
}
ReclaimFor(key, producer, finalizer);
_a1in.AddFirst(key);
return _slots[key];
}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:26,代码来源:LRU2QXCache.cs
示例5: AbstractFreespaceManager
public AbstractFreespaceManager(IProcedure4 slotFreedCallback, int discardLimit,
int remainderSizeLimit)
{
_slotFreedCallback = slotFreedCallback;
_discardLimit = discardLimit;
_remainderSizeLimit = remainderSizeLimit;
}
开发者ID:erdincay,项目名称:db4o,代码行数:7,代码来源:AbstractFreespaceManager.cs
示例6: EventInfo
public EventInfo(string eventFirerName, bool isClientServerEvent, IProcedure4 eventListenerSetter
)
{
_listenerSetter = eventListenerSetter;
_eventFirerName = eventFirerName;
_isClientServerEvent = isClientServerEvent;
}
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:EventInfo.cs
示例7: Produce
public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
)
{
object value = _slots[key];
if (value == null)
{
object newValue = producer.Apply(key);
if (newValue == null)
{
return null;
}
if (_slots.Count >= _maxSize)
{
object discarded = Sharpen.Collections.Remove(_slots, _lru.RemoveLast());
if (null != finalizer)
{
finalizer.Apply(discarded);
}
}
_slots[key] = newValue;
_lru.AddFirst(key);
return newValue;
}
_lru.Remove(key);
// O(N)
_lru.AddFirst(key);
return value;
}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:28,代码来源:LRUCache.cs
示例8: AssertEventThrows
private void AssertEventThrows(string eventName, ICodeBlock codeBlock, IProcedure4
listenerSetter)
{
IEventRegistry eventRegistry = EventRegistryFactory.ForObjectContainer(Db());
listenerSetter.Apply(eventRegistry);
Assert.Expect(typeof(EventException), typeof(NotImplementedException), codeBlock,
eventName);
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:8,代码来源:ExceptionPropagationInEventsTestUnit.cs
示例9: Discard
private void Discard(long key, IProcedure4 finalizer)
{
if (null != finalizer)
{
finalizer.Apply(_slots[key]);
}
Sharpen.Collections.Remove(_slots, key);
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:8,代码来源:LRU2QLongCache.cs
示例10: DiscardPage
private void DiscardPage(IProcedure4 finalizer)
{
if (_a1.Size() >= _a1_threshold)
{
DiscardPageFrom(_a1, finalizer);
}
else
{
DiscardPageFrom(_am, finalizer);
}
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:11,代码来源:LRU2QLongCache.cs
示例11: Time
private static long Time(IProcedure4 procedure4)
{
var storage = new PagingMemoryStorage();
StoreItems(storage);
StopWatch stopWatch = new AutoStopWatch();
for (var i = 0; i < Iterations; ++i)
{
ApplyProcedure(storage, procedure4);
}
return stopWatch.Peek();
}
开发者ID:masroore,项目名称:db4o,代码行数:11,代码来源:SodaQueryComparatorBenchmark.cs
示例12: CachingBin
/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
public CachingBin(IBin bin, ICache4 cache, int pageCount, int pageSize) : base(bin
)
{
_onDiscardPage = new _IProcedure4_22(this);
_producerFromDisk = new _IFunction4_138(this);
_producerFromPool = new _IFunction4_147(this);
_pageSize = pageSize;
_pagePool = new SimpleObjectPool(NewPagePool(pageCount));
_cache = cache;
_fileLength = _bin.Length();
}
开发者ID:erdincay,项目名称:db4o,代码行数:12,代码来源:CachingBin.cs
示例13: ForEachField
public static void ForEachField(IReflectClass claxx, IProcedure4 procedure)
{
while (claxx != null)
{
IReflectField[] declaredFields = claxx.GetDeclaredFields();
for (int reflectFieldIndex = 0; reflectFieldIndex < declaredFields.Length; ++reflectFieldIndex)
{
IReflectField reflectField = declaredFields[reflectFieldIndex];
procedure.Apply(reflectField);
}
claxx = claxx.GetSuperclass();
}
}
开发者ID:erdincay,项目名称:db4o,代码行数:13,代码来源:ReflectorUtils.cs
示例14: WithCache
private void WithCache(IProcedure4 procedure)
{
IClientSlotCache clientSlotCache = null;
try
{
clientSlotCache = (IClientSlotCache) Reflection4.GetFieldValue(Container(), "_clientSlotCache"
);
}
catch (ReflectException e)
{
Assert.Fail("Can't get field _clientSlotCache on container. " + e);
}
procedure.Apply(clientSlotCache);
}
开发者ID:masroore,项目名称:db4o,代码行数:14,代码来源:ClientSlotCacheTestCase.cs
示例15: ApplyProcedure
private static void ApplyProcedure(PagingMemoryStorage storage, IProcedure4 procedure4
)
{
var config = Db4oEmbedded.NewConfiguration();
config.File.Storage = storage;
var container = Db4oEmbedded.OpenFile(config, "benchmark.db4o"
);
try
{
procedure4.Apply(container);
}
finally
{
container.Close();
}
}
开发者ID:masroore,项目名称:db4o,代码行数:16,代码来源:SodaQueryComparatorBenchmark.cs
示例16: AssertInconsistencyDetected
private void AssertInconsistencyDetected(IProcedure4 proc)
{
IEmbeddedConfiguration config = NewConfiguration();
LocalObjectContainer db = (LocalObjectContainer)Db4oEmbedded.OpenFile(config, TempFile
());
try
{
ConsistencyCheckerTestCase.Item item = new ConsistencyCheckerTestCase.Item();
db.Store(item);
db.Commit();
Assert.IsTrue(new ConsistencyChecker(db).CheckSlotConsistency().Consistent());
proc.Apply(new Pair(db, item));
db.Commit();
Assert.IsFalse(new ConsistencyChecker(db).CheckSlotConsistency().Consistent());
}
finally
{
db.Close();
}
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:20,代码来源:ConsistencyCheckerTestCase.cs
示例17: Produce
public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
)
{
if (_am.Remove((((long)key))))
{
_am.AddFirst((((long)key)));
return _slots[((long)key)];
}
if (_a1.Remove((((long)key))))
{
_am.AddFirst((((long)key)));
return _slots[((long)key)];
}
if (_slots.Count >= _maxSize)
{
DiscardPage(finalizer);
}
object value = producer.Apply(((long)key));
_slots[((long)key)] = value;
_a1.AddFirst((((long)key)));
return value;
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:22,代码来源:LRU2QLongCache.cs
示例18: ReclaimFor
private void ReclaimFor(object key, IFunction4 producer, IProcedure4 finalizer)
{
if (_slots.Count < _maxSize)
{
_slots[key] = producer.Apply(key);
return;
}
if (_a1in.Size() > _inSize)
{
object lastKey = _a1in.RemoveLast();
Discard(lastKey, finalizer);
if (_a1out.IsFull())
{
_a1out.RemoveLast();
}
_a1out.AddFirst(lastKey);
}
else
{
object lastKey = _am.RemoveLast();
Discard(lastKey, finalizer);
}
_slots[key] = producer.Apply(key);
}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:24,代码来源:LRU2QXCache.cs
示例19: ForEachClassId
private void ForEachClassId(IProcedure4 procedure)
{
for (IEnumerator ids = _stream.ClassCollection().Ids(); ids.MoveNext(); )
{
procedure.Apply((int)ids.Current);
}
}
开发者ID:erdincay,项目名称:db4o,代码行数:7,代码来源:KnownClassesRepository.cs
示例20: DiscardPageFrom
private void DiscardPageFrom(CircularLongBuffer4 list, IProcedure4 finalizer)
{
Discard(list.RemoveLast(), finalizer);
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:4,代码来源:LRU2QLongCache.cs
注:本文中的IProcedure4类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论