Skip to content

Commit

Permalink
Rename Reference to RefCounted
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomShaper committed Jun 11, 2021
1 parent fbb5a54 commit 04688b9
Show file tree
Hide file tree
Showing 270 changed files with 926 additions and 926 deletions.
6 changes: 3 additions & 3 deletions core/config/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ Engine::Singleton::Singleton(const StringName &p_name, Object *p_ptr) :
name(p_name),
ptr(p_ptr) {
#ifdef DEBUG_ENABLED
Reference *ref = Object::cast_to<Reference>(p_ptr);
if (ref && !ref->is_referenced()) {
WARN_PRINT("You must use Ref<> to ensure the lifetime of a Reference object intended to be used as a singleton.");
RefCounted *rc = Object::cast_to<RefCounted>(p_ptr);
if (rc && !rc->is_referenced()) {
WARN_PRINT("You must use Ref<> to ensure the lifetime of a RefCounted object intended to be used as a singleton.");
}
#endif
}
2 changes: 1 addition & 1 deletion core/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,7 @@ Variant _ClassDB::instance(const StringName &p_class) const {
return Variant();
}

Reference *r = Object::cast_to<Reference>(obj);
RefCounted *r = Object::cast_to<RefCounted>(obj);
if (r) {
return REF(r);
} else {
Expand Down
24 changes: 12 additions & 12 deletions core/core_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ class _Geometry3D : public Object {
_Geometry3D() { singleton = this; }
};

class _File : public Reference {
GDCLASS(_File, Reference);
class _File : public RefCounted {
GDCLASS(_File, RefCounted);

FileAccess *f = nullptr;
bool big_endian = false;
Expand Down Expand Up @@ -455,8 +455,8 @@ class _File : public Reference {
VARIANT_ENUM_CAST(_File::ModeFlags);
VARIANT_ENUM_CAST(_File::CompressionMode);

class _Directory : public Reference {
GDCLASS(_Directory, Reference);
class _Directory : public RefCounted {
GDCLASS(_Directory, RefCounted);
DirAccess *d;
bool dir_open = false;

Expand Down Expand Up @@ -525,8 +525,8 @@ class _Marshalls : public Object {
~_Marshalls() { singleton = nullptr; }
};

class _Mutex : public Reference {
GDCLASS(_Mutex, Reference);
class _Mutex : public RefCounted {
GDCLASS(_Mutex, RefCounted);
Mutex mutex;

static void _bind_methods();
Expand All @@ -537,8 +537,8 @@ class _Mutex : public Reference {
void unlock();
};

class _Semaphore : public Reference {
GDCLASS(_Semaphore, Reference);
class _Semaphore : public RefCounted {
GDCLASS(_Semaphore, RefCounted);
Semaphore semaphore;

static void _bind_methods();
Expand All @@ -549,8 +549,8 @@ class _Semaphore : public Reference {
void post();
};

class _Thread : public Reference {
GDCLASS(_Thread, Reference);
class _Thread : public RefCounted {
GDCLASS(_Thread, RefCounted);

protected:
Variant ret;
Expand Down Expand Up @@ -666,8 +666,8 @@ class _Engine : public Object {

class _JSON;

class JSONParseResult : public Reference {
GDCLASS(JSONParseResult, Reference);
class JSONParseResult : public RefCounted {
GDCLASS(JSONParseResult, RefCounted);

friend class _JSON;

Expand Down
6 changes: 3 additions & 3 deletions core/crypto/aes_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
#define AES_CONTEXT_H

#include "core/crypto/crypto_core.h"
#include "core/object/reference.h"
#include "core/object/ref_counted.h"

class AESContext : public Reference {
GDCLASS(AESContext, Reference);
class AESContext : public RefCounted {
GDCLASS(AESContext, RefCounted);

public:
enum Mode {
Expand Down
10 changes: 5 additions & 5 deletions core/crypto/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "core/io/resource.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/object/reference.h"
#include "core/object/ref_counted.h"

class CryptoKey : public Resource {
GDCLASS(CryptoKey, Resource);
Expand Down Expand Up @@ -67,8 +67,8 @@ class X509Certificate : public Resource {
virtual Error save(String p_path) = 0;
};

class HMACContext : public Reference {
GDCLASS(HMACContext, Reference);
class HMACContext : public RefCounted {
GDCLASS(HMACContext, RefCounted);

protected:
static void _bind_methods();
Expand All @@ -84,8 +84,8 @@ class HMACContext : public Reference {
HMACContext() {}
};

class Crypto : public Reference {
GDCLASS(Crypto, Reference);
class Crypto : public RefCounted {
GDCLASS(Crypto, RefCounted);

protected:
static void _bind_methods();
Expand Down
2 changes: 1 addition & 1 deletion core/crypto/crypto_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef CRYPTO_CORE_H
#define CRYPTO_CORE_H

#include "core/object/reference.h"
#include "core/object/ref_counted.h"

class CryptoCore {
public:
Expand Down
6 changes: 3 additions & 3 deletions core/crypto/hashing_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
#ifndef HASHING_CONTEXT_H
#define HASHING_CONTEXT_H

#include "core/object/reference.h"
#include "core/object/ref_counted.h"

class HashingContext : public Reference {
GDCLASS(HashingContext, Reference);
class HashingContext : public RefCounted {
GDCLASS(HashingContext, RefCounted);

public:
enum HashType {
Expand Down
4 changes: 2 additions & 2 deletions core/debugger/remote_debugger_peer.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
#define REMOTE_DEBUGGER_PEER_H

#include "core/io/stream_peer_tcp.h"
#include "core/object/reference.h"
#include "core/object/ref_counted.h"
#include "core/os/mutex.h"
#include "core/os/thread.h"
#include "core/string/ustring.h"

class RemoteDebuggerPeer : public Reference {
class RemoteDebuggerPeer : public RefCounted {
protected:
int max_queued_messages = 4096;

Expand Down
6 changes: 3 additions & 3 deletions core/io/config_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
#define CONFIG_FILE_H

#include "core/io/file_access.h"
#include "core/object/reference.h"
#include "core/object/ref_counted.h"
#include "core/templates/ordered_hash_map.h"
#include "core/variant/variant_parser.h"

class ConfigFile : public Reference {
GDCLASS(ConfigFile, Reference);
class ConfigFile : public RefCounted {
GDCLASS(ConfigFile, RefCounted);

OrderedHashMap<String, OrderedHashMap<String, Variant>> values;

Expand Down
4 changes: 2 additions & 2 deletions core/io/dtls_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include "core/io/net_socket.h"
#include "core/io/packet_peer_dtls.h"

class DTLSServer : public Reference {
GDCLASS(DTLSServer, Reference);
class DTLSServer : public RefCounted {
GDCLASS(DTLSServer, RefCounted);

protected:
static DTLSServer *(*_create)();
Expand Down
6 changes: 3 additions & 3 deletions core/io/http_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
#include "core/io/ip.h"
#include "core/io/stream_peer.h"
#include "core/io/stream_peer_tcp.h"
#include "core/object/reference.h"
#include "core/object/ref_counted.h"

class HTTPClient : public Reference {
GDCLASS(HTTPClient, Reference);
class HTTPClient : public RefCounted {
GDCLASS(HTTPClient, RefCounted);

public:
enum ResponseCode {
Expand Down
6 changes: 3 additions & 3 deletions core/io/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef JSON_H
#define JSON_H

#include "core/object/reference.h"
#include "core/object/ref_counted.h"
#include "core/variant/variant.h"
class JSON {
enum TokenType {
Expand Down Expand Up @@ -74,8 +74,8 @@ class JSON {
static Error parse(const String &p_json, Variant &r_ret, String &r_err_str, int &r_err_line);
};

class JSONParser : public Reference {
GDCLASS(JSONParser, Reference);
class JSONParser : public RefCounted {
GDCLASS(JSONParser, RefCounted);

Variant data;
String string;
Expand Down
6 changes: 3 additions & 3 deletions core/io/marshalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "marshalls.h"

#include "core/object/reference.h"
#include "core/object/ref_counted.h"
#include "core/os/keyboard.h"
#include "core/string/print_string.h"

Expand Down Expand Up @@ -489,8 +489,8 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
obj->set(str, value);
}

if (Object::cast_to<Reference>(obj)) {
REF ref = REF(Object::cast_to<Reference>(obj));
if (Object::cast_to<RefCounted>(obj)) {
REF ref = REF(Object::cast_to<RefCounted>(obj));
r_variant = ref;
} else {
r_variant = obj;
Expand Down
6 changes: 3 additions & 3 deletions core/io/marshalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef MARSHALLS_H
#define MARSHALLS_H

#include "core/object/reference.h"
#include "core/object/ref_counted.h"
#include "core/typedefs.h"
#include "core/variant/variant.h"

Expand Down Expand Up @@ -165,8 +165,8 @@ static inline double decode_double(const uint8_t *p_arr) {
return md.d;
}

class EncodedObjectAsID : public Reference {
GDCLASS(EncodedObjectAsID, Reference);
class EncodedObjectAsID : public RefCounted {
GDCLASS(EncodedObjectAsID, RefCounted);

ObjectID id;

Expand Down
6 changes: 3 additions & 3 deletions core/io/multiplayer_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
#define MULTIPLAYER_API_H

#include "core/io/networked_multiplayer_peer.h"
#include "core/object/reference.h"
#include "core/object/ref_counted.h"

class MultiplayerAPI : public Reference {
GDCLASS(MultiplayerAPI, Reference);
class MultiplayerAPI : public RefCounted {
GDCLASS(MultiplayerAPI, RefCounted);

public:
enum RPCMode {
Expand Down
4 changes: 2 additions & 2 deletions core/io/net_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#define NET_SOCKET_H

#include "core/io/ip.h"
#include "core/object/reference.h"
#include "core/object/ref_counted.h"

class NetSocket : public Reference {
class NetSocket : public RefCounted {
protected:
static NetSocket *(*_create)();

Expand Down
4 changes: 2 additions & 2 deletions core/io/packed_data_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class PackedDataContainer : public Resource {
PackedDataContainer() {}
};

class PackedDataContainerRef : public Reference {
GDCLASS(PackedDataContainerRef, Reference);
class PackedDataContainerRef : public RefCounted {
GDCLASS(PackedDataContainerRef, RefCounted);

friend class PackedDataContainer;
uint32_t offset = 0;
Expand Down
4 changes: 2 additions & 2 deletions core/io/packet_peer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#include "core/object/class_db.h"
#include "core/templates/ring_buffer.h"

class PacketPeer : public Reference {
GDCLASS(PacketPeer, Reference);
class PacketPeer : public RefCounted {
GDCLASS(PacketPeer, RefCounted);

Variant _bnd_get_var(bool p_allow_objects = false);

Expand Down
6 changes: 3 additions & 3 deletions core/io/pck_packer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
#ifndef PCK_PACKER_H
#define PCK_PACKER_H

#include "core/object/reference.h"
#include "core/object/ref_counted.h"

class FileAccess;

class PCKPacker : public Reference {
GDCLASS(PCKPacker, Reference);
class PCKPacker : public RefCounted {
GDCLASS(PCKPacker, RefCounted);

FileAccess *file = nullptr;
int alignment = 0;
Expand Down
6 changes: 3 additions & 3 deletions core/io/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define RESOURCE_H

#include "core/object/class_db.h"
#include "core/object/reference.h"
#include "core/object/ref_counted.h"
#include "core/templates/safe_refcount.h"
#include "core/templates/self_list.h"

Expand All @@ -43,8 +43,8 @@ public:
\
private:

class Resource : public Reference {
GDCLASS(Resource, Reference);
class Resource : public RefCounted {
GDCLASS(Resource, RefCounted);
OBJ_CATEGORY("Resources");

public:
Expand Down
4 changes: 2 additions & 2 deletions core/io/resource_importer.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class ResourceFormatImporter : public ResourceFormatLoader {
ResourceFormatImporter();
};

class ResourceImporter : public Reference {
GDCLASS(ResourceImporter, Reference);
class ResourceImporter : public RefCounted {
GDCLASS(ResourceImporter, RefCounted);

public:
virtual String get_importer_name() const = 0;
Expand Down
4 changes: 2 additions & 2 deletions core/io/resource_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#include "core/os/semaphore.h"
#include "core/os/thread.h"

class ResourceFormatLoader : public Reference {
GDCLASS(ResourceFormatLoader, Reference);
class ResourceFormatLoader : public RefCounted {
GDCLASS(ResourceFormatLoader, RefCounted);

public:
enum CacheMode {
Expand Down
4 changes: 2 additions & 2 deletions core/io/resource_saver.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

#include "core/io/resource.h"

class ResourceFormatSaver : public Reference {
GDCLASS(ResourceFormatSaver, Reference);
class ResourceFormatSaver : public RefCounted {
GDCLASS(ResourceFormatSaver, RefCounted);

protected:
static void _bind_methods();
Expand Down
Loading

0 comments on commit 04688b9

Please sign in to comment.