Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
/* $XConsortium: Resource.h /main/1 1996/07/29 17:02:54 cde-hp $ */
// Copyright (c) 1994 James Clark
// See the file COPYING for copying permission.
#ifndef Resource_INCLUDED
#define Resource_INCLUDED 1
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
#ifndef SP_API
#define SP_API /* as nothing */
#endif
class SP_API Resource {
public:
Resource();
Resource(const Resource &);
int unref(); // return 1 if it should be deleted
void ref();
int count() const;
private:
int count_;
};
inline
Resource::Resource()
: count_(0)
{
}
inline
Resource::Resource(const Resource &)
: count_(0)
{
}
inline
int Resource::count() const
{
return count_;
}
inline
int Resource::unref()
{
return --count_ <= 0;
}
inline
void Resource::ref()
{
++count_;
}
#ifdef SP_NAMESPACE
}
#endif
#endif /* not Resource_INCLUDED */