C# 클래스 FiftyOne.Foundation.Mobile.Detection.Factories.MemoryFactory

Factory class used to create a DataSet from a source data structure. All the entities are held in memory and the source data structure not referenced once the data set is created.

The memory usage of the resulting data set following initialisation will be consistent. The performance of the data set will be very fast compared to the stream based implementation as all required data is loaded into memory and references between related objects set at initialisation. However overall memory usage will be higher than the stream based implementation on lightly loaded environments.

Create a fully initialised DataSet: DataSet dataSet = MemoryFactory.Create("path_to_file", true); The resulting data set can then be used to work with data or used in a FiftyOne.Foundation.Mobile.Detection.Provider to perform device detections. Use in provider like: Provider p = new Provider(dataSet);

This is a factory that creates a memory resident version of the 51Degrees device data in the form of a DataSet object.

For more information see https://51degrees.com/Support/Documentation/Net

Initialisation may take several seconds depending on system performance. Initialisation calculates all the references between entities. If initialisation is not performed then references will be calculated when needed. As such avoiding initialisation improves the time taken to create the data set, at the expense of performance for the initial detections. The default setting is to initialise the data set.
파일 보기 프로젝트 열기: 51Degrees/dotNET-Device-Detection

공개 메소드들

메소드 설명
Create ( byte array ) : FiftyOne.Foundation.Mobile.Detection.Entities.DataSet

Creates a new DataSet from the byte array.

Create ( byte array, bool init ) : FiftyOne.Foundation.Mobile.Detection.Entities.DataSet

Creates a new DataSet from the byte array.

Create ( string filePath ) : FiftyOne.Foundation.Mobile.Detection.Entities.DataSet

Creates a new DataSet from the file provided. The last modified date of the data set is the last write time of the data file provided.

Create ( string filePath, bool init ) : FiftyOne.Foundation.Mobile.Detection.Entities.DataSet

Creates a new DataSet from the file provided.

Create ( string filePath, bool init, System.DateTime lastModified ) : FiftyOne.Foundation.Mobile.Detection.Entities.DataSet

Creates a new DataSet from the file provided.

비공개 메소드들

메소드 설명
Load ( FiftyOne.Foundation.Mobile.Detection.Entities.DataSet dataSet, Reader reader, bool init ) : void

Creates a new DataSet from the binary reader provided.

메소드 상세

Create() 공개 정적인 메소드

Creates a new DataSet from the byte array.
public static Create ( byte array ) : FiftyOne.Foundation.Mobile.Detection.Entities.DataSet
array byte Array of bytes to build the data set from
리턴 FiftyOne.Foundation.Mobile.Detection.Entities.DataSet

Create() 공개 정적인 메소드

Creates a new DataSet from the byte array.
public static Create ( byte array, bool init ) : FiftyOne.Foundation.Mobile.Detection.Entities.DataSet
array byte Array of bytes to build the data set from
init bool True to indicate that the data set should be fulling /// initialised
리턴 FiftyOne.Foundation.Mobile.Detection.Entities.DataSet

Create() 공개 정적인 메소드

Creates a new DataSet from the file provided. The last modified date of the data set is the last write time of the data file provided.
public static Create ( string filePath ) : FiftyOne.Foundation.Mobile.Detection.Entities.DataSet
filePath string /// Uncompressed file containing the data for the data set ///
리턴 FiftyOne.Foundation.Mobile.Detection.Entities.DataSet

Create() 공개 정적인 메소드

Creates a new DataSet from the file provided.
public static Create ( string filePath, bool init ) : FiftyOne.Foundation.Mobile.Detection.Entities.DataSet
filePath string /// Uncompressed file containing the data for the data set ///
init bool /// True to indicate that the data set should be fully initialised ///
리턴 FiftyOne.Foundation.Mobile.Detection.Entities.DataSet

Create() 공개 정적인 메소드

Creates a new DataSet from the file provided.
public static Create ( string filePath, bool init, System.DateTime lastModified ) : FiftyOne.Foundation.Mobile.Detection.Entities.DataSet
filePath string /// Uncompressed file containing the data for the data set ///
init bool /// True to indicate that the data set should be fully initialised ///
lastModified System.DateTime Date and time the source data was last /// modified.
리턴 FiftyOne.Foundation.Mobile.Detection.Entities.DataSet