|
|
|
@ -3,10 +3,9 @@ |
|
|
|
// Copyright(c) 2020 SimonG. All Rights Reserved. |
|
|
|
// Copyright(c) 2020 SimonG. All Rights Reserved. |
|
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using GBase.Api; |
|
|
|
|
|
|
|
using GBase.Exceptions; |
|
|
|
|
|
|
|
using GBase.FileHandling.Factories; |
|
|
|
using GBase.FileHandling.Factories; |
|
|
|
using GBase.Interfaces; |
|
|
|
using GBase.Interfaces; |
|
|
|
|
|
|
|
using GBase.Interfaces.DataHandling.Pool; |
|
|
|
using GBase.Interfaces.FileHandling; |
|
|
|
using GBase.Interfaces.FileHandling; |
|
|
|
|
|
|
|
|
|
|
|
namespace GBase.Factories |
|
|
|
namespace GBase.Factories |
|
|
|
@ -17,16 +16,19 @@ namespace GBase.Factories |
|
|
|
public class GBaseTableFactory : IGBaseTableFactory |
|
|
|
public class GBaseTableFactory : IGBaseTableFactory |
|
|
|
{ |
|
|
|
{ |
|
|
|
private readonly IFileHandlerFactory _fileHandlerFactory; |
|
|
|
private readonly IFileHandlerFactory _fileHandlerFactory; |
|
|
|
|
|
|
|
private readonly IDataHandlerPool _dataHandlerPool; |
|
|
|
private readonly IGBaseColumnFactory _gBaseColumnFactory; |
|
|
|
private readonly IGBaseColumnFactory _gBaseColumnFactory; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// Factory for the <see cref="IGBaseTable"/> |
|
|
|
/// Factory for the <see cref="IGBaseTable"/> |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
/// <param name="fileHandlerFactory">Factory for the <see cref="IFileHandler"/></param> |
|
|
|
/// <param name="fileHandlerFactory">Factory for the <see cref="IFileHandler"/></param> |
|
|
|
|
|
|
|
/// <param name="dataHandlerPool"></param> |
|
|
|
/// <param name="gBaseColumnFactory">Factory for the <see cref="IGBaseColumn"/></param> |
|
|
|
/// <param name="gBaseColumnFactory">Factory for the <see cref="IGBaseColumn"/></param> |
|
|
|
public GBaseTableFactory(IFileHandlerFactory fileHandlerFactory, IGBaseColumnFactory gBaseColumnFactory) |
|
|
|
public GBaseTableFactory(IFileHandlerFactory fileHandlerFactory, IDataHandlerPool dataHandlerPool, IGBaseColumnFactory gBaseColumnFactory) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_fileHandlerFactory = fileHandlerFactory; |
|
|
|
_fileHandlerFactory = fileHandlerFactory; |
|
|
|
|
|
|
|
_dataHandlerPool = dataHandlerPool; |
|
|
|
_gBaseColumnFactory = gBaseColumnFactory; |
|
|
|
_gBaseColumnFactory = gBaseColumnFactory; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -37,7 +39,7 @@ namespace GBase.Factories |
|
|
|
public IGBaseTable Create(Type type) |
|
|
|
public IGBaseTable Create(Type type) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Type gBaseTableType = typeof(GBaseTable<>).MakeGenericType(type); |
|
|
|
Type gBaseTableType = typeof(GBaseTable<>).MakeGenericType(type); |
|
|
|
return (IGBaseTable) Activator.CreateInstance(gBaseTableType, _fileHandlerFactory, _gBaseColumnFactory); |
|
|
|
return (IGBaseTable) Activator.CreateInstance(gBaseTableType, _fileHandlerFactory, _dataHandlerPool, _gBaseColumnFactory); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |