ArcObjects Library Reference (DataSourcesGDB)  

InMemoryWorkspaceFactory CoClass

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Extended Error Information

Use the ISupportErrorInfo method InterfaceSupportsErrorInfo to determine if the object supports extended error information. If the object supports extended error info, VC++ developers should use the OLE/COM IErrorInfo interface to access the ErrorInfo object. Visual Basic developers should use the global error object Err to retrieve this extended error information.

Interfaces

Interfaces Description
ISupportErrorInfo Indicates whether a specific interface can return Automation error objects.
IWorkspaceFactory (esriGeoDatabase) Provides access to members that create and open workspaces and supply workspace factory information.
IWorkspaceFactory2 (esriGeoDatabase) Provides access to members that create and open workspaces and supply workspace factory information.

Remarks

An InMemoryWorkspaceFactory is used to connect to a temporary workspace which is stored in memory. These workspaces are commonly used to hold the results of an analysis operation or to hold objects in memory before persisting them to disk. When an in-memory workspace is no longer needed, it is the developer's responsibility to call IDataset.Delete on the workspace to release its memory.

InMemory workspaces support tables and simple feature classes with geometries of point, multipoint, multipatch, polyline and polygon. Zs and Ms are supported.  Feature classes and tables contained within InMemory workspaces support the full geodatabase model in terms of being used in conjunction with cursors, selections, etc.

What follows is a description of what is not supported by InMemory workspaces.  This list may not be exhaustive as it reflects the most commonly used aspects of the Geodatabase data model.  InMemory workspaces do not support the following:

[C#]

The following example shows how to create an InMemory workspace.

// Create an in-memory workspace factory.
IWorkspaceFactory workspaceFactory = new InMemoryWorkspaceFactoryClass();

// Create a new in-memory workspace. This returns a name object.
IWorkspaceName workspaceName = workspaceFactory.Create(null, "MyWorkspace", null, 0);
IName name = (IName)workspaceName;

// Open the workspace through the name object.
IWorkspace workspace = (IWorkspace)name.Open();
InMemoryWorkspaceFactory is the one and only instance of its class.