Main Table of Contents


Table of Contents

class PtWorkspace
PtWorkspace: class summary
PtWorkspace::PtWorkspace()
PtWorkspace::~PtWorkspace()
PtWorkspace::AbortCheckOut()
PtWorkspace::BeginCheckOut()
PtWorkspace::cast2PtWorkspace()
PtWorkspace::CheckIn()
PtWorkspace::Close()
PtWorkspace::CommitCheckOut()
PtWorkspace::IsWorkspace()
PtWorkspace::Open()
PtWorkspace::UpdateSource()
PtWorkspace

class PtWorkspace


Intro
PtWorkspace: class summary
PtWorkspace::PtWorkspace()
PtWorkspace::~PtWorkspace()
PtWorkspace::AbortCheckOut()
PtWorkspace::BeginCheckOut()
PtWorkspace::cast2PtWorkspace()
PtWorkspace::CheckIn()
PtWorkspace::Close()
PtWorkspace::CommitCheckOut()
PtWorkspace::IsWorkspace()
PtWorkspace::Open()
PtWorkspace::UpdateSource()

A workspace is a database used for checking objects into and out of another database. Workspaces are described in the Programmer's Guide in the chapter "CheckIn/CheckOut." PtWorkspace is the class used to check objects into a workspace or to update the original database with the current version of the workspace's objects.


PtWorkspace: class summary


Intro

Files to include Class declaration Base class
poet.hxx ptws.hxx ptws.hxx PtBase

Member functions:

constructor PtWorkspace(PtBase* parent);
destructor virtual ~PtWorkspace();
AbortCheckOut int AbortCheckOut();
BeginCheckOut int BeginCheckOut();
cast2PtWorkspace virtual PtWorkspace* cast2PtWorkspace();
CheckIn int CheckIn();
Close virtual int Close();
CommitCheckOut int CommitCheckOut();
IsWorkspace virtual int IsWorkspace();
Open virtual int Open(char* name, PtOpenMode mode = PtOPEN_RW, PtClassDict* = 0, PtAssoc* ass = __PtRootAssoc.first);
Update int UpdateSource();

PtWorkspace::PtWorkspace()


Intro

Declaration:

PtWorkspace::PtWorkspace(PtBase* parent)

Description:

Constructor. Requires a pointer to an opened PtBase for the database which originally created this workspace with PtBase:: CreateWorkspace().

Parameters:

PtBase* parent The database which originally created this workspace

PtWorkspace::~PtWorkspace()


Intro

Declaration:

virtual PtWorkspace::~PtWorkspace()

Description:

Destructor.


PtWorkspace::AbortCheckOut()


Intro

Declaration:

int PtWorkspace::AbortCheckOut()

Description:

Aborts the current check out. After this function is called, all changes to the workspace or the original database that are associated with the check out have been undone. This function terminates the transaction which was started by BeginCheckOut(). If you want to check out more objects, you must call BeginCheckOut() again.


PtWorkspace::BeginCheckOut()


Intro

Declaration:

int PtWorkspace::BeginCheckOut()

Description:

Enables the workspace to check out objects from the original database using PtObject::CheckOut(), PtObjectSet::CheckOut(), or PtOnDemand::CheckOut(). All check outs made after a BeginCheckOut() are made within an internal transaction. AbortCheckOut() aborts all check outs, and CommitCheckOut() commits them.

This function will fail if you are currently in a user transaction.


PtWorkspace::cast2PtWorkspace()


Intro

Declaration:

virtual PtWorkspace* cast2PtWorkspace()

Description:

This function corresponds to PtBase::cast2PtWorkspace(), which casts a PtBase pointer to a PtWorkspace pointer. Since a PtWorkspace is always a workspace, this function always returns a non-zero value.


PtWorkspace::CheckIn()


Intro

Declaration:

int PtWorkspace::CheckIn()

Description:

Checks all objects from the workspace into the database, and removes the persistent locks which were left when the objects were checked out. Any objects which were created in the workspace are given a new, permanent identity in the database. After CheckIn() returns, there are no more objects left in the workspace, and the workspace's files are deleted.


PtWorkspace::Close()


Intro

Declaration:

virtual int PtWorkspace::Close()

Description:

Closes the workspace database.


PtWorkspace::CommitCheckOut()


Intro

Declaration:

int PtWorkspace::CommitCheckOut()

Description:

Commits all check outs to the workspace. After this function is called all objects which were checked out are in the workspace, and they are locked in the original database. This function terminates the transaction which was started by BeginCheckOut(). If you want to check out more objects, you must call BeginCheckOut() again.


PtWorkspace::IsWorkspace()


Intro

Declaration:

virtual int PtWorkspace::IsWorkspace()

Description:

This function corresponds to PtBase::IsWorkspace(), which reports whether a given database is a workspace. Since a PtWorkspace is always a workspace, this function always returns a non-zero value.


PtWorkspace::Open()


Intro

Declaration:

virtual int PtWorkspace::Open(const PtString& name, PtOpenMode mode = PtOPEN_RW, PtClassDict* = 0, PtAssoc* ass = __PtRootAssoc.first)

Description:

Opens the workspace as a database. You will normally specify only the first parameter.

This differs from PtBase:: Open() in that it refuses to open the database if the PtBase pointer which was passed as a parameter to the PtWorkspace's constructor does not point to a PtBase which has opened the original database.


PtWorkspace::UpdateSource()


Intro

Declaration:

int PtWorkspace::UpdateSource()

Description:

Writes all objects from the workspace into the database, but the objects remain checked out, and their locks remain in the original database. Any new objects which have been created in the workspace are given permanent object identities in the original database, and their permanent object identities are also assigned to them in the workspace.

Copyright (c) 1996 POET Software, Inc. All rights reserved. Reproduction in whole or in part in any form or medium without the express permission of POET Software, Inc. is prohibited.