mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:07:34 +00:00
Add clang-format file
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
This commit is contained in:
parent
c11351ac50
commit
0dc9af5f7e
286 changed files with 3244 additions and 2424 deletions
|
@ -1,23 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include "Assertions.h"
|
||||
#include "Retainable.h"
|
||||
#include "RetainPtr.h"
|
||||
#include "Retainable.h"
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<typename T> class Weakable;
|
||||
template<typename T> class WeakPtr;
|
||||
template<typename T>
|
||||
class Weakable;
|
||||
template<typename T>
|
||||
class WeakPtr;
|
||||
|
||||
template<typename T>
|
||||
class WeakLink : public Retainable<WeakLink<T>> {
|
||||
friend class Weakable<T>;
|
||||
|
||||
public:
|
||||
T* ptr() { return static_cast<T*>(m_ptr); }
|
||||
const T* ptr() const { return static_cast<const T*>(m_ptr); }
|
||||
|
||||
private:
|
||||
explicit WeakLink(T& weakable) : m_ptr(&weakable) { }
|
||||
explicit WeakLink(T& weakable)
|
||||
: m_ptr(&weakable)
|
||||
{
|
||||
}
|
||||
T* m_ptr;
|
||||
};
|
||||
|
||||
|
@ -25,11 +31,12 @@ template<typename T>
|
|||
class Weakable {
|
||||
private:
|
||||
class Link;
|
||||
|
||||
public:
|
||||
WeakPtr<T> make_weak_ptr();
|
||||
|
||||
protected:
|
||||
Weakable() { }
|
||||
Weakable() {}
|
||||
|
||||
~Weakable()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue