version 1.1.2.7, 2005/10/14 13:42:31
|
version 1.5.2.1, 2006/03/03 20:23:23
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
#ifndef _Pegasus_StringRep_h | #ifndef _Pegasus_StringRep_h |
#define _Pegasus_StringRep_h | #define _Pegasus_StringRep_h |
| |
#include <Pegasus/Common/IPC.h> |
#include <Pegasus/Common/Config.h> |
|
#include <Pegasus/Common/AtomicInt.h> |
#include <new> | #include <new> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
|
|
| |
static StringRep* create(const char* data, size_t size); | static StringRep* create(const char* data, size_t size); |
| |
static StringRep* createASCII7(const char* data, size_t size); |
|
|
|
static StringRep* copyOnWrite(StringRep* rep); | static StringRep* copyOnWrite(StringRep* rep); |
| |
static Uint32 length(const Uint16* str); | static Uint32 length(const Uint16* str); |
|
|
inline StringRep::~StringRep() | inline StringRep::~StringRep() |
{ | { |
// Only called on _emptyRep. | // Only called on _emptyRep. |
refs.~AtomicInt(); |
|
} | } |
| |
inline void StringRep::ref(const StringRep* rep) | inline void StringRep::ref(const StringRep* rep) |
|
|
inline void StringRep::unref(const StringRep* rep) | inline void StringRep::unref(const StringRep* rep) |
{ | { |
if (rep != &StringRep::_emptyRep && | if (rep != &StringRep::_emptyRep && |
((StringRep*)rep)->refs.DecAndTestIfZero()) |
((StringRep*)rep)->refs.decAndTestIfZero()) |
StringRep::free((StringRep*)rep); | StringRep::free((StringRep*)rep); |
} | } |
| |