Rename KShared

pull/1/head
Timothy Pearson 11 years ago
parent 758e85b36d
commit 8d6fecdf83

@ -106,7 +106,7 @@ const char* destructorPrefix = "<destructor>";
}
TypePointer CppCodeCompletion::createGlobalNamespace() {
KSharedPtr<SimpleTypeCachedNamespace> n = new SimpleTypeCachedNamespace( TQStringList(), TQStringList() );
TDESharedPtr<SimpleTypeCachedNamespace> n = new SimpleTypeCachedNamespace( TQStringList(), TQStringList() );
n->addAliases(m_pSupport->codeCompletionConfig()->namespaceAliases() );
return n.data();
}

@ -90,7 +90,7 @@ namespace CppEvaluation
}
struct ExpressionInfo;
typedef KSharedPtr<SimpleTypeImpl> TypePointer;
typedef TDESharedPtr<SimpleTypeImpl> TypePointer;
class CppCodeCompletion : public TQObject
{

@ -40,7 +40,7 @@ class SimpleTypeImpl;
class SimpleTypeNamespace;
class SimpleTypeFunctionInterface;
typedef KSharedPtr<SimpleTypeImpl> TypePointer;
typedef TDESharedPtr<SimpleTypeImpl> TypePointer;
///if this is set, imported items will get their parent set to the node they were acquired through(which may increase the overall count of items, decrease the caching-performance, and may create other problems in locating stuff)
//#define PHYSICAL_IMPORT
@ -220,7 +220,7 @@ class SimpleTypeConfiguration {
};
class SimpleTypeImpl : public KShared {
class SimpleTypeImpl : public TDEShared {
/*enum ResolutionFlags {
NoFlag = 0,
HadTypedef = 1,
@ -229,7 +229,7 @@ class SimpleTypeImpl : public KShared {
};*/
public:
typedef KSharedPtr<SimpleTypeImpl> TypePointer;
typedef TDESharedPtr<SimpleTypeImpl> TypePointer;
SimpleTypeImpl( const TQStringList& scope ) : m_resolutionCount( 0 ), m_resolutionFlags( NoFlag ), m_scope( scope ) {
setScope( m_scope );
@ -363,7 +363,7 @@ class SimpleTypeImpl : public KShared {
int m_resolutionCount;
ResolutionFlags m_resolutionFlags;
SimpleTypeImpl( const SimpleTypeImpl& /*rhs*/ ) : KShared() {}
SimpleTypeImpl( const SimpleTypeImpl& /*rhs*/ ) : TDEShared() {}
SimpleTypeImpl& operator = ( const SimpleTypeImpl& /*rhs*/ ) {
return * this;
@ -502,7 +502,7 @@ class SimpleTypeImpl : public KShared {
}
///An abstract class for building types lazily
struct TypeBuildInfo : public KShared {
struct TypeBuildInfo : public TDEShared {
TypePointer buildCached() {
if ( m_cache )
return m_cache;
@ -529,14 +529,14 @@ class SimpleTypeImpl : public KShared {
Q_UNUSED( rhs );
return *this;
}
TypeBuildInfo( const TypeBuildInfo& rhs ) : KShared() {
TypeBuildInfo( const TypeBuildInfo& rhs ) : TDEShared() {
Q_UNUSED( rhs );
}
};
///A class that stores information about a member of some SimpleType
class MemberInfo {
KSharedPtr<TypeBuildInfo> m_build;
TDESharedPtr<TypeBuildInfo> m_build;
public:
enum MemberType {
@ -575,9 +575,9 @@ class SimpleTypeImpl : public KShared {
};
}
typedef KSharedPtr<SimpleTypeImpl> TypePointer;
typedef TDESharedPtr<SimpleTypeImpl> TypePointer;
void setBuildInfo( KSharedPtr<TypeBuildInfo> build ) {
void setBuildInfo( TDESharedPtr<TypeBuildInfo> build ) {
m_build = build;
}
@ -712,7 +712,7 @@ class SimpleTypeImpl : public KShared {
return TQValueList<TypePointer>();
}
/**TypeDescs and SimpleTypeImpls usually have a cross-reference, which creates a circular dependency so that they are never freed using KShared. This function breaks the loop, and also breaks all other possible dependency-loops. After this function was called, the type still contains its private information, but can not not be used to resolve anything anymore. This function is called automatically while the destruction of SimpleTypeConfiguration */
/**TypeDescs and SimpleTypeImpls usually have a cross-reference, which creates a circular dependency so that they are never freed using TDEShared. This function breaks the loop, and also breaks all other possible dependency-loops. After this function was called, the type still contains its private information, but can not not be used to resolve anything anymore. This function is called automatically while the destruction of SimpleTypeConfiguration */
virtual void breakReferences();
///Returns either itself, or the (namespace-)proxy this type is a slave of.

@ -209,7 +209,7 @@ void TypeDesc::setIncludeFiles( const HashedStringSet& files ) {
(*it)->setIncludeFiles( files );
}
if( m_data->m_nextType ) {
if( m_data->m_nextType->_KShared_count() != 1 )
if( m_data->m_nextType->_TDEShared_count() != 1 )
m_data->m_nextType = new TypeDescShared( *(m_data->m_nextType) );
m_data->m_nextType->setIncludeFiles( files );
}
@ -222,7 +222,7 @@ void TypeDesc::addIncludeFiles( const HashedStringSet& files ) {
(*it)->addIncludeFiles( files );
}
if( m_data->m_nextType ) {
if( m_data->m_nextType->_KShared_count() != 1 )
if( m_data->m_nextType->_TDEShared_count() != 1 )
m_data->m_nextType = new TypeDescShared( *(m_data->m_nextType) );
m_data->m_nextType->addIncludeFiles( files );
}
@ -485,7 +485,7 @@ TypeDescPointer TypeDesc::next() {
return m_data->m_nextType;
}
KSharedPtr<const TypeDescShared> TypeDesc::next() const {
TDESharedPtr<const TypeDescShared> TypeDesc::next() const {
if ( !m_data )
return 0;
return m_data->m_nextType.data();

@ -27,8 +27,8 @@ class SimpleTypeImpl;
class TypeTrace;
typedef KSharedPtr<TypeDescShared> TypeDescPointer;
typedef KSharedPtr<SimpleTypeImpl> TypePointer;
typedef TDESharedPtr<TypeDescShared> TypeDescPointer;
typedef TDESharedPtr<SimpleTypeImpl> TypePointer;
enum ResolutionFlags {
NoFlag = 0,
@ -144,7 +144,7 @@ enum TypeDescFlags {
};
struct TypeDescData : public KShared {
struct TypeDescData : public TDEShared {
typedef TQValueList<LocateResult> TemplateParams;
TQString m_cleanName;
int m_pointerDepth;
@ -323,7 +323,7 @@ class TypeDesc {
TypeDescPointer next();
KSharedPtr<const TypeDescShared> next() const;
TDESharedPtr<const TypeDescShared> next() const;
bool hasTemplateParams() const ;
@ -372,20 +372,20 @@ class TypeDesc {
private:
void takeData( const TQString& string );
void makeDataPrivate();
KSharedPtr<TypeDescData> m_data;
TDESharedPtr<TypeDescData> m_data;
void maybeInit();
void init( TQString stri );
};
class TypeDescShared : public TypeDesc, public KShared {
class TypeDescShared : public TypeDesc, public TDEShared {
public:
TypeDescShared( const TypeDescShared& rhs ) : TypeDesc( rhs ), KShared() {}
TypeDescShared( const TypeDescShared& rhs ) : TypeDesc( rhs ), TDEShared() {}
TypeDescShared( const TypeDesc& rhs ) : TypeDesc( rhs ), KShared() {}
TypeDescShared( const TypeDesc& rhs ) : TypeDesc( rhs ), TDEShared() {}
TypeDescShared& operator = ( const TypeDesc& rhs ) {
( *( TypeDesc* ) this ) = rhs;

@ -1553,10 +1553,10 @@ private:
};
class TranslationUnitAST: public AST, public KShared
class TranslationUnitAST: public AST, public TDEShared
{
public:
typedef KSharedPtr<TranslationUnitAST> Node;
typedef TDESharedPtr<TranslationUnitAST> Node;
enum { Type = NodeType_TranslationUnit };
DECLARE_ALLOC( TranslationUnitAST )

@ -52,7 +52,7 @@ enum
typedef TQPair<TQString, int> Dependence;
class ParsedFile;
typedef KSharedPtr< ParsedFile > ParsedFilePointer;
typedef TDESharedPtr< ParsedFile > ParsedFilePointer;
class ParsedFile : public AbstractParseResult {
public:

@ -28,7 +28,7 @@
class LexerCache;
class CachedLexedFile : public KShared, public CacheNode {
class CachedLexedFile : public TDEShared, public CacheNode {
public:
///@todo add and manage the set of included files
CachedLexedFile( const HashedString& fileName, LexerCache* manager );
@ -107,7 +107,7 @@ class CachedLexedFile : public KShared, public CacheNode {
*/
};
typedef KSharedPtr<CachedLexedFile> CachedLexedFilePointer;
typedef TDESharedPtr<CachedLexedFile> CachedLexedFilePointer;
struct CachedLexedFilePointerCompare {
bool operator() ( const CachedLexedFilePointer& lhs, const CachedLexedFilePointer& rhs ) const {

@ -43,7 +43,7 @@ enum ParsedFileType {
CppParsedFile
};
class AbstractParseResult : public KShared {
class AbstractParseResult : public TDEShared {
public:
virtual void read( TQDataStream& stream ) = 0;
@ -52,7 +52,7 @@ public:
virtual ParsedFileType type() const = 0;
};
typedef KSharedPtr<AbstractParseResult> ParseResultPointer;
typedef TDESharedPtr<AbstractParseResult> ParseResultPointer;
using namespace std;
@ -72,90 +72,90 @@ class TypeAliasModel;
/**
@class ItemDom
Safe pointer to the @ref CodeModelItem.
This is a type definition: @code typedef KSharedPtr<CodeModelItem> ItemDom; @endcode
@sa KSharedPtr
This is a type definition: @code typedef TDESharedPtr<CodeModelItem> ItemDom; @endcode
@sa TDESharedPtr
*/
typedef KSharedPtr<CodeModelItem> ItemDom;
typedef TDESharedPtr<CodeModelItem> ItemDom;
/**
@class FileDom
Safe pointer to the @ref FileModel.
This is a type definition: @code typedef KSharedPtr<FileModel> FileDom; @endcode
@sa KSharedPtr
This is a type definition: @code typedef TDESharedPtr<FileModel> FileDom; @endcode
@sa TDESharedPtr
*/
typedef KSharedPtr<FileModel> FileDom;
typedef TDESharedPtr<FileModel> FileDom;
/**
@class NamespaceDom
Safe pointer to the @ref NamespaceModel.
This is a type definition: @code typedef KSharedPtr<NamespaceModel> NamespaceDom; @endcode
@sa KSharedPtr
This is a type definition: @code typedef TDESharedPtr<NamespaceModel> NamespaceDom; @endcode
@sa TDESharedPtr
*/
typedef KSharedPtr<NamespaceModel> NamespaceDom;
typedef TDESharedPtr<NamespaceModel> NamespaceDom;
/**
@class ClassDom
Safe pointer to the @ref ClassModel.
This is a type definition: @code typedef KSharedPtr<ClassModel> ClassDom; @endcode
@sa KSharedPtr
This is a type definition: @code typedef TDESharedPtr<ClassModel> ClassDom; @endcode
@sa TDESharedPtr
*/
typedef KSharedPtr<ClassModel> ClassDom;
typedef TDESharedPtr<ClassModel> ClassDom;
/**
@class FunctionDom
Safe pointer to the @ref FunctionModel.
This is a type definition: @code typedef KSharedPtr<FunctionModel> FunctionDom; @endcode
@sa KSharedPtr
This is a type definition: @code typedef TDESharedPtr<FunctionModel> FunctionDom; @endcode
@sa TDESharedPtr
*/
typedef KSharedPtr<FunctionModel> FunctionDom;
typedef TDESharedPtr<FunctionModel> FunctionDom;
/**
@class FunctionDefinitionDom
Safe pointer to the @ref FunctionDefinitionModel.
This is a type definition: @code typedef KSharedPtr<FunctionDefinitionModel> FunctionDefinitionDom; @endcode
@sa KSharedPtr
This is a type definition: @code typedef TDESharedPtr<FunctionDefinitionModel> FunctionDefinitionDom; @endcode
@sa TDESharedPtr
*/
typedef KSharedPtr<FunctionDefinitionModel> FunctionDefinitionDom;
typedef TDESharedPtr<FunctionDefinitionModel> FunctionDefinitionDom;
/**
@class VariableDom
Safe pointer to the @ref VariableModel.
This is a type definition: @code typedef KSharedPtr<VariableModel> VariableDom; @endcode
@sa KSharedPtr
This is a type definition: @code typedef TDESharedPtr<VariableModel> VariableDom; @endcode
@sa TDESharedPtr
*/
typedef KSharedPtr<VariableModel> VariableDom;
typedef TDESharedPtr<VariableModel> VariableDom;
/**
@class ArgumentDom
Safe pointer to the @ref ArgumentModel.
This is a type definition: @code typedef KSharedPtr<ArgumentModel> ArgumentDom; @endcode
@sa KSharedPtr
This is a type definition: @code typedef TDESharedPtr<ArgumentModel> ArgumentDom; @endcode
@sa TDESharedPtr
*/
typedef KSharedPtr<ArgumentModel> ArgumentDom;
typedef TDESharedPtr<ArgumentModel> ArgumentDom;
/**
@class EnumDom
Safe pointer to the @ref EnumModel.
This is a type definition: @code typedef KSharedPtr<EnumModel> EnumDom; @endcode
@sa KSharedPtr
This is a type definition: @code typedef TDESharedPtr<EnumModel> EnumDom; @endcode
@sa TDESharedPtr
*/
typedef KSharedPtr<EnumModel> EnumDom;
typedef TDESharedPtr<EnumModel> EnumDom;
/**
@class TypeAliasDom
Safe pointer to the @ref TypeAliasModel.
This is a type definition: @code typedef KSharedPtr<TypeAliasModel> TypeAliasDom; @endcode
@sa KSharedPtr
This is a type definition: @code typedef TDESharedPtr<TypeAliasModel> TypeAliasDom; @endcode
@sa TDESharedPtr
*/
typedef KSharedPtr<TypeAliasModel> TypeAliasDom;
typedef TDESharedPtr<TypeAliasModel> TypeAliasDom;
/**
@class EnumeratorDom
Safe pointer to the @ref EnumeratorModel.
This is a type definition: @code typedef KSharedPtr<EnumeratorModel> EnumeratorDom; @endcode
@sa KSharedPtr
This is a type definition: @code typedef TDESharedPtr<EnumeratorModel> EnumeratorDom; @endcode
@sa TDESharedPtr
*/
typedef KSharedPtr<EnumeratorModel> EnumeratorDom;
typedef TDESharedPtr<EnumeratorModel> EnumeratorDom;
/**
@class ItemList
@ -271,7 +271,7 @@ TQStringList sortedNameList( const ItemList& lst )
}
/**
Casts safe code model pointers (@p KSharedPtr<T> objects like
Casts safe code model pointers (@p TDESharedPtr<T> objects like
FileDom, NamespaceDom, etc.) to the @p Result type.
Example:
@ -282,7 +282,7 @@ ClassDom cl = model_cast<ClassDom>(ns);
@param x Object to cast.
*/
template <class Result, class T>
Result model_cast( KSharedPtr<T> x )
Result model_cast( TDESharedPtr<T> x )
{
Result r( static_cast<T*>(x) );
return r;
@ -458,7 +458,7 @@ variables, arguments, enums and enumerators, type aliases.
Instances of this class should be created using @ref CodeModel::create method but usually
it is better to create instances of derived classes like ClassModel, NamespaceModel, FileModel, etc.
*/
class CodeModelItem: public KShared
class CodeModelItem: public TDEShared
{
public:
/**A definition of safe pointer to the code model item.*/

@ -60,7 +60,7 @@ void HashedString::initHash() {
}
class HashedStringSetData : public KShared {
class HashedStringSetData : public TDEShared {
public:
#ifdef USE_HASHMAP
typedef __gnu_cxx::hash_set<HashedString> StringSet;
@ -121,7 +121,7 @@ HashedStringSet& HashedStringSet::operator +=( const HashedStringSet& rhs ) {
return * this;
#ifndef USE_HASHMAP
KSharedPtr<HashedStringSetData> oldData = m_data;
TDESharedPtr<HashedStringSetData> oldData = m_data;
if( !oldData ) oldData = new HashedStringSetData();
m_data = new HashedStringSetData();
std::set_union( oldData->m_files.begin(), oldData->m_files.end(), rhs.m_data->m_files.begin(), rhs.m_data->m_files.end(), std::insert_iterator<HashedStringSetData::StringSet>( m_data->m_files, m_data->m_files.end() ) );
@ -142,7 +142,7 @@ HashedStringSet& HashedStringSet::operator -=( const HashedStringSet& rhs ) {
if( !m_data ) return *this;
if( !rhs.m_data ) return *this;
#ifndef USE_HASHMAP
KSharedPtr<HashedStringSetData> oldData = m_data;
TDESharedPtr<HashedStringSetData> oldData = m_data;
m_data = new HashedStringSetData();
std::set_difference( oldData->m_files.begin(), oldData->m_files.end(), rhs.m_data->m_files.begin(), rhs.m_data->m_files.end(), std::insert_iterator<HashedStringSetData::StringSet>( m_data->m_files, m_data->m_files.end() ) );
#else
@ -164,7 +164,7 @@ void HashedStringSet::makeDataPrivate() {
m_data = new HashedStringSetData();
return ;
}
if ( m_data->_KShared_count() != 1 )
if ( m_data->_TDEShared_count() != 1 )
m_data = new HashedStringSetData( *m_data );
}

@ -116,7 +116,7 @@ class HashedStringSet {
private:
friend class HashedStringSetGroup;
void makeDataPrivate();
KSharedPtr<HashedStringSetData> m_data; //this implies some additional cost because KShared's destructor is virtual. Maybe change that by copying KShared without the virtual destructor.
TDESharedPtr<HashedStringSetData> m_data; //this implies some additional cost because TDEShared's destructor is virtual. Maybe change that by copying TDEShared without the virtual destructor.
friend HashedStringSet operator + ( const HashedStringSet& lhs, const HashedStringSet& rhs );
};

@ -110,13 +110,13 @@ ClassViewWidget::~ClassViewWidget( )
}
template <class ModelType, class ListItemType>
static bool selectItemG( ItemDom item, const TQMap<KSharedPtr<ModelType>, ListItemType*>& map )
static bool selectItemG( ItemDom item, const TQMap<TDESharedPtr<ModelType>, ListItemType*>& map )
{
ModelType* c = dynamic_cast<ModelType*>( &(*item) );
if( c ) {
KSharedPtr<ModelType> d( c );
typename TQMap<KSharedPtr<ModelType>, ListItemType*>::ConstIterator it = map.find(d);
TDESharedPtr<ModelType> d( c );
typename TQMap<TDESharedPtr<ModelType>, ListItemType*>::ConstIterator it = map.find(d);
if( it != map.end() ) {
( *it )->select();
return true;

Loading…
Cancel
Save