├── .clang-format ├── .gitignore ├── LICENSE ├── Phantom.lua ├── Premake-vs2015.bat ├── Premake-vs2017.bat ├── Premake-vs2019.bat ├── README.md ├── natvis └── Phantom.natvis ├── premake ├── extend.lua ├── functions.lua ├── premake5 └── premake5.exe └── projects ├── HelloWorld ├── HelloWorld.premake.lua └── main.cpp └── Phantom ├── Phantom.pch.cpp ├── Phantom.pch.h ├── Phantom.premake.lua ├── haunt ├── haunt.bind ├── haunt.ignore ├── phantom ├── CustomAllocator.h ├── CustomAllocator.hxx ├── CustomAllocator.hxx.cpp ├── UserData.h ├── UserData.hxx ├── UserData.hxx.cpp ├── alias ├── alias_template ├── alignof ├── allocate ├── assert.h ├── class ├── classof ├── constant ├── constructor ├── customize.h ├── deallocate ├── default_value ├── detail │ ├── Allocator.h │ ├── ClassOfFwd.h │ ├── Constructor.h │ ├── ConstructorCaller.h │ ├── Copier.h │ ├── EnumOfFwd.h │ ├── Hasher.h │ ├── LambdaCapture.h │ ├── MemoryContext.cpp │ ├── MemoryContext.h │ ├── MethodClosure.h │ ├── ModuleRegistrationInfo.cpp │ ├── ModuleRegistrationInfo.h │ ├── Mover.h │ ├── PP │ │ ├── PHANTOM_PP_ADD_PREFIX_EACH.h │ │ └── PHANTOM_PP_DEC.h │ ├── Registrer.h │ ├── Signal.h │ ├── StaticGlobalRegistrer.cpp │ ├── StaticGlobalRegistrer.h │ ├── StaticGlobals.cpp │ ├── StaticGlobals.h │ ├── StringConverter.h │ ├── TypeInstallationInfo.h │ ├── TypeOfFwd.h │ ├── UnionOfFwd.h │ ├── config.h │ ├── core.cpp │ ├── core.h │ ├── core_internal.h │ ├── macros.h │ ├── memory.cpp │ ├── memory.h │ ├── preprocessor.h │ ├── typedefs.h │ ├── typedefs.hxx │ └── typedefs.hxx.cpp ├── enum ├── enum_class ├── enumof ├── field ├── friend ├── function ├── fwd.h ├── fwd.hxx ├── fwd.hxx.cpp ├── haunt.h ├── lang │ ├── Aggregate.cpp │ ├── Aggregate.h │ ├── Aggregate.hxx │ ├── Aggregate.hxx.cpp │ ├── Alias.cpp │ ├── Alias.h │ ├── Alias.hxx │ ├── Alias.hxx.cpp │ ├── AnonymousSection.cpp │ ├── AnonymousSection.h │ ├── AnonymousSection.hxx │ ├── AnonymousSection.hxx.cpp │ ├── AnonymousStruct.cpp │ ├── AnonymousStruct.h │ ├── AnonymousStruct.hxx │ ├── AnonymousStruct.hxx.cpp │ ├── AnonymousUnion.cpp │ ├── AnonymousUnion.h │ ├── AnonymousUnion.hxx │ ├── AnonymousUnion.hxx.cpp │ ├── Application.cpp │ ├── Application.h │ ├── Application.hxx │ ├── Application.hxx.cpp │ ├── Array.cpp │ ├── Array.h │ ├── Array.hxx │ ├── Array.hxx.cpp │ ├── ArrayClass.cpp │ ├── ArrayClass.h │ ├── ArrayClass.hxx │ ├── ArrayClass.hxx.cpp │ ├── ArrayClassT.h │ ├── BaseClassProviderT.h │ ├── CallHelpers.h │ ├── Callable.cpp │ ├── Callable.h │ ├── Callable.hxx │ ├── Callable.hxx.cpp │ ├── Class.cpp │ ├── Class.h │ ├── Class.hxx │ ├── Class.hxx.cpp │ ├── ClassT.h │ ├── ClassType.cpp │ ├── ClassType.h │ ├── ClassType.hxx │ ├── ClassType.hxx.cpp │ ├── ClassTypeT.h │ ├── CodeLocation.cpp │ ├── CodeLocation.h │ ├── CodeLocation.hxx │ ├── CodeLocation.hxx.cpp │ ├── ConstType.cpp │ ├── ConstType.h │ ├── ConstType.hxx │ ├── ConstType.hxx.cpp │ ├── ConstVolatileType.cpp │ ├── ConstVolatileType.h │ ├── ConstVolatileType.hxx │ ├── ConstVolatileType.hxx.cpp │ ├── Constant.cpp │ ├── Constant.h │ ├── Constant.hxx │ ├── Constant.hxx.cpp │ ├── ConstantT.h │ ├── Constructor.cpp │ ├── Constructor.h │ ├── Constructor.hxx │ ├── Constructor.hxx.cpp │ ├── ConstructorT.h │ ├── ContainerClass.cpp │ ├── ContainerClass.h │ ├── ContainerClass.hxx │ ├── ContainerClass.hxx.cpp │ ├── ContainerClassT.h │ ├── CppSymbolParser.cpp │ ├── CppSymbolParser.h │ ├── CppSymbolParser.hxx │ ├── CppSymbolParser.hxx.cpp │ ├── DataElement.cpp │ ├── DataElement.h │ ├── DataElement.hxx │ ├── DataElement.hxx.cpp │ ├── DataMember.h │ ├── DataMember.hxx │ ├── Destructor.cpp │ ├── Destructor.h │ ├── Destructor.hxx │ ├── Destructor.hxx.cpp │ ├── DestructorT.h │ ├── Enum.cpp │ ├── Enum.h │ ├── Enum.hxx │ ├── Enum.hxx.cpp │ ├── EnumT.h │ ├── ExecutionContext.cpp │ ├── ExecutionContext.h │ ├── ExecutionContext.hxx │ ├── ExecutionContext.hxx.cpp │ ├── ExtendedType.h │ ├── ExtendedType.hxx │ ├── ExtendedType.hxx.cpp │ ├── Field.cpp │ ├── Field.h │ ├── Field.hxx │ ├── Field.hxx.cpp │ ├── FieldH.h │ ├── FieldPointer.cpp │ ├── FieldPointer.h │ ├── FieldPointer.hxx │ ├── FieldPointer.hxx.cpp │ ├── FieldPointerT.h │ ├── FieldT.h │ ├── Function.cpp │ ├── Function.h │ ├── Function.hxx │ ├── Function.hxx.cpp │ ├── FunctionPointer.cpp │ ├── FunctionPointer.h │ ├── FunctionPointer.hxx │ ├── FunctionPointer.hxx.cpp │ ├── FunctionPointerCustomConventionT.h │ ├── FunctionPointerT.h │ ├── FunctionProviderT.h │ ├── FunctionT.h │ ├── FunctionT_PerCallConv.h │ ├── FunctionType.cpp │ ├── FunctionType.h │ ├── FunctionType.hxx │ ├── FunctionType.hxx.cpp │ ├── FunctorProperty.cpp │ ├── FunctorProperty.h │ ├── FunctorProperty.hxx │ ├── FunctorProperty.hxx.cpp │ ├── FundamentalsT.h │ ├── Import.cpp │ ├── Import.h │ ├── Import.hxx │ ├── Import.hxx.cpp │ ├── InitializerListType.cpp │ ├── InitializerListType.h │ ├── InitializerListType.hxx │ ├── InitializerListType.hxx.cpp │ ├── InstanceCache.cpp │ ├── InstanceCache.h │ ├── InstanceCache.hxx │ ├── InstanceCache.hxx.cpp │ ├── LValueReference.cpp │ ├── LValueReference.h │ ├── LValueReference.hxx │ ├── LValueReference.hxx.cpp │ ├── LanguageElement.cpp │ ├── LanguageElement.h │ ├── LanguageElement.hxx │ ├── LanguageElement.hxx.cpp │ ├── LanguageElementVisitor.cpp │ ├── LanguageElementVisitor.h │ ├── LanguageElementVisitor.hxx │ ├── LanguageElementVisitor.hxx.cpp │ ├── LocalVariable.cpp │ ├── LocalVariable.h │ ├── LocalVariable.hxx │ ├── LocalVariable.hxx.cpp │ ├── MapClass.cpp │ ├── MapClass.h │ ├── MapClass.hxx │ ├── MapClass.hxx.cpp │ ├── MapClassT.h │ ├── MemberAnonymousSection.cpp │ ├── MemberAnonymousSection.h │ ├── MemberAnonymousSection.hxx │ ├── MemberAnonymousSection.hxx.cpp │ ├── MemberAnonymousStruct.cpp │ ├── MemberAnonymousStruct.h │ ├── MemberAnonymousStruct.hxx │ ├── MemberAnonymousStruct.hxx.cpp │ ├── MemberAnonymousUnion.cpp │ ├── MemberAnonymousUnion.h │ ├── MemberAnonymousUnion.hxx │ ├── MemberAnonymousUnion.hxx.cpp │ ├── MemberFunction.h │ ├── MemberFunction.hxx │ ├── MemberPointer.cpp │ ├── MemberPointer.h │ ├── MemberPointer.hxx │ ├── MemberPointer.hxx.cpp │ ├── Members.h │ ├── MetaNewDelete.h │ ├── Method.cpp │ ├── Method.h │ ├── Method.hxx │ ├── Method.hxx.cpp │ ├── MethodBaseT.h │ ├── MethodPointer.cpp │ ├── MethodPointer.h │ ├── MethodPointer.hxx │ ├── MethodPointer.hxx.cpp │ ├── MethodPointerBaseT.h │ ├── MethodPointerT.h │ ├── MethodProviderT.h │ ├── MethodT.h │ ├── Module.cpp │ ├── Module.h │ ├── Module.hxx │ ├── Module.hxx.cpp │ ├── Namespace.cpp │ ├── Namespace.h │ ├── Namespace.hxx │ ├── Namespace.hxx.cpp │ ├── NativeVTableInspector.cpp │ ├── NativeVTableInspector.h │ ├── NativeVTablePointerExtractor.h │ ├── NativeVTableSizeComputer.h │ ├── NestedT.h │ ├── Package.cpp │ ├── Package.h │ ├── Package.hxx │ ├── Package.hxx.cpp │ ├── PackageFolder.cpp │ ├── PackageFolder.h │ ├── PackageFolder.hxx │ ├── PackageFolder.hxx.cpp │ ├── Parameter.cpp │ ├── Parameter.h │ ├── Parameter.hxx │ ├── Parameter.hxx.cpp │ ├── Placeholder.cpp │ ├── Placeholder.h │ ├── Placeholder.hxx │ ├── Placeholder.hxx.cpp │ ├── PlaceholderClass.cpp │ ├── PlaceholderClass.h │ ├── PlaceholderClass.hxx │ ├── PlaceholderClass.hxx.cpp │ ├── PlaceholderClassType.cpp │ ├── PlaceholderClassType.h │ ├── PlaceholderClassType.hxx │ ├── PlaceholderClassType.hxx.cpp │ ├── PlaceholderConstant.cpp │ ├── PlaceholderConstant.h │ ├── PlaceholderConstant.hxx │ ├── PlaceholderConstant.hxx.cpp │ ├── PlaceholderTemplate.cpp │ ├── PlaceholderTemplate.h │ ├── PlaceholderTemplate.hxx │ ├── PlaceholderTemplate.hxx.cpp │ ├── PlaceholderType.cpp │ ├── PlaceholderType.h │ ├── PlaceholderType.hxx │ ├── PlaceholderType.hxx.cpp │ ├── Plugin.cpp │ ├── Plugin.h │ ├── Plugin.hxx │ ├── Plugin.hxx.cpp │ ├── Pointer.cpp │ ├── Pointer.h │ ├── Pointer.hxx │ ├── Pointer.hxx.cpp │ ├── PointerType.cpp │ ├── PointerType.h │ ├── PointerType.hxx │ ├── PointerType.hxx.cpp │ ├── PrimitiveType.cpp │ ├── PrimitiveType.h │ ├── PrimitiveType.hxx │ ├── PrimitiveType.hxx.cpp │ ├── PrimitiveTypeT.h │ ├── Promoter.h │ ├── Property.cpp │ ├── Property.h │ ├── Property.hxx │ ├── Property.hxx.cpp │ ├── PropertyT.h │ ├── QualifiedType.cpp │ ├── QualifiedType.h │ ├── QualifiedType.hxx │ ├── QualifiedType.hxx.cpp │ ├── RValueReference.cpp │ ├── RValueReference.h │ ├── RValueReference.hxx │ ├── RValueReference.hxx.cpp │ ├── RecursiveInstanceVisitorT.h │ ├── RecursiveInstanceVisitorT.hxx │ ├── RecursiveInstanceVisitorT.hxx.cpp │ ├── Reference.cpp │ ├── Reference.h │ ├── Reference.hxx │ ├── Reference.hxx.cpp │ ├── Scope.cpp │ ├── Scope.h │ ├── Scope.hxx │ ├── Scope.hxx.cpp │ ├── SequentialContainerClass.cpp │ ├── SequentialContainerClass.h │ ├── SequentialContainerClass.hxx │ ├── SequentialContainerClass.hxx.cpp │ ├── SequentialContainerClassT.h │ ├── SetClass.cpp │ ├── SetClass.h │ ├── SetClass.hxx │ ├── SetClass.hxx.cpp │ ├── SetClassT.h │ ├── Signature.cpp │ ├── Signature.h │ ├── Signature.hxx │ ├── Signature.hxx.cpp │ ├── SignatureH.h │ ├── Source.cpp │ ├── Source.h │ ├── Source.hxx │ ├── Source.hxx.cpp │ ├── SourceFile.cpp │ ├── SourceFile.h │ ├── SourceFile.hxx │ ├── SourceFile.hxx.cpp │ ├── SourceStream.cpp │ ├── SourceStream.h │ ├── SourceStream.hxx │ ├── SourceStream.hxx.cpp │ ├── StaticField.h │ ├── StaticField.hxx │ ├── StaticMethod.h │ ├── StaticMethod.hxx │ ├── StaticVariable.h │ ├── StaticVariable.hxx │ ├── StringClass.cpp │ ├── StringClass.h │ ├── StringClass.hxx │ ├── StringClass.hxx.cpp │ ├── StringClassT.h │ ├── Structure.cpp │ ├── Structure.h │ ├── Structure.hxx │ ├── Structure.hxx.cpp │ ├── StructureT.h │ ├── Subroutine.cpp │ ├── Subroutine.h │ ├── Subroutine.hxx │ ├── Subroutine.hxx.cpp │ ├── Symbol.cpp │ ├── Symbol.h │ ├── Symbol.hxx │ ├── Symbol.hxx.cpp │ ├── Template.cpp │ ├── Template.h │ ├── Template.hxx │ ├── Template.hxx.cpp │ ├── TemplateDependantArray.cpp │ ├── TemplateDependantArray.h │ ├── TemplateDependantArray.hxx │ ├── TemplateDependantArray.hxx.cpp │ ├── TemplateDependantElement.cpp │ ├── TemplateDependantElement.h │ ├── TemplateDependantElement.hxx │ ├── TemplateDependantElement.hxx.cpp │ ├── TemplateDependantTemplateInstance.cpp │ ├── TemplateDependantTemplateInstance.h │ ├── TemplateDependantTemplateInstance.hxx │ ├── TemplateDependantTemplateInstance.hxx.cpp │ ├── TemplateDependantType.cpp │ ├── TemplateDependantType.h │ ├── TemplateDependantType.hxx │ ├── TemplateDependantType.hxx.cpp │ ├── TemplateParameter.cpp │ ├── TemplateParameter.h │ ├── TemplateParameter.hxx │ ├── TemplateParameter.hxx.cpp │ ├── TemplateSignature.cpp │ ├── TemplateSignature.h │ ├── TemplateSignature.hxx │ ├── TemplateSignature.hxx.cpp │ ├── TemplateSpecialization.cpp │ ├── TemplateSpecialization.h │ ├── TemplateSpecialization.hxx │ ├── TemplateSpecialization.hxx.cpp │ ├── TemplateSubstitution.cpp │ ├── TemplateSubstitution.h │ ├── TemplateSubstitution.hxx │ ├── TemplateSubstitution.hxx.cpp │ ├── Type.cpp │ ├── Type.h │ ├── Type.hxx │ ├── Type.hxx.cpp │ ├── TypeIndex.h │ ├── TypeIndex.hxx │ ├── TypeIndex.hxx.cpp │ ├── TypeInfos.h │ ├── TypeOf.cpp │ ├── TypeOf.h │ ├── TypeT.h │ ├── Undefineds.cpp │ ├── Undefineds.h │ ├── Undefineds.hxx │ ├── Undefineds.hxx.cpp │ ├── Union.cpp │ ├── Union.h │ ├── Union.hxx │ ├── Union.hxx.cpp │ ├── UnionT.h │ ├── ValueMember.cpp │ ├── ValueMember.h │ ├── ValueMember.hxx │ ├── ValueMember.hxx.cpp │ ├── Variable.cpp │ ├── Variable.h │ ├── Variable.hxx │ ├── Variable.hxx.cpp │ ├── VariableT.h │ ├── VectorClass.cpp │ ├── VectorClass.h │ ├── VectorClass.hxx │ ├── VectorClass.hxx.cpp │ ├── VectorClassT.h │ ├── VirtualMethodTable.cpp │ ├── VirtualMethodTable.h │ ├── VirtualMethodTable.hxx │ ├── VirtualMethodTable.hxx.cpp │ ├── VolatileType.cpp │ ├── VolatileType.h │ ├── VolatileType.hxx │ ├── VolatileType.hxx.cpp │ ├── reflection.cpp │ ├── reflection.h │ ├── reflection.hxx │ ├── reflection.hxx.cpp │ ├── reflection_fwd.h │ ├── reflection_fwd.hxx │ ├── reflection_fwd.hxx.cpp │ ├── registration │ │ ├── Alias.h │ │ ├── AliasTemplate.h │ │ ├── AliasTemplate.hxx │ │ ├── AliasTemplate.hxx.cpp │ │ ├── Annotation.h │ │ ├── Class.h │ │ ├── ClassType.h │ │ ├── Constant.h │ │ ├── Enum.h │ │ ├── Field.h │ │ ├── Forward.h │ │ ├── Friend.h │ │ ├── Function.h │ │ ├── GlobalRegistrer.cpp │ │ ├── GlobalRegistrer.h │ │ ├── Main.h │ │ ├── Main.hxx │ │ ├── Main.hxx.cpp │ │ ├── MemberAnonymousSection.h │ │ ├── MetaType.h │ │ ├── Method.h │ │ ├── Namespace.h │ │ ├── PackageSource.h │ │ ├── Plugin.h │ │ ├── Privates.h │ │ ├── Property.h │ │ ├── Scope.h │ │ ├── Signal.h │ │ ├── Template.h │ │ ├── TemplateInstance.h │ │ ├── TemplateParam.h │ │ ├── Type.h │ │ ├── Union.h │ │ ├── Variable.h │ │ ├── registration.cpp │ │ └── registration.h │ └── stack.hh ├── main ├── meta_type ├── method ├── namespace ├── namespace_alias ├── package ├── plugin ├── plugin.h ├── private ├── property ├── register ├── signal ├── source ├── stacked ├── static_constant ├── static_field ├── static_method ├── statics ├── struct ├── template ├── template-only-pop ├── template-only-push ├── thread │ ├── LockGuard.h │ ├── LockGuard.hxx │ ├── LockGuard.hxx.cpp │ ├── RecursiveMutex.h │ ├── RecursiveMutex.hxx │ ├── RecursiveMutex.hxx.cpp │ ├── RecursiveSemaphore.h │ ├── RecursiveSemaphore.hxx │ ├── RecursiveSemaphore.hxx.cpp │ ├── RecursiveSpinMutex.h │ ├── RecursiveSpinMutex.hxx │ ├── RecursiveSpinMutex.hxx.cpp │ ├── Semaphore.cpp │ ├── Semaphore.h │ ├── Semaphore.hxx │ ├── Semaphore.hxx.cpp │ ├── SpinMutex.h │ ├── SpinMutex.hxx │ ├── SpinMutex.hxx.cpp │ ├── ThreadSafeArrayView.h │ ├── ThreadSafeArrayView.hxx │ └── ThreadSafeArrayView.hxx.cpp ├── traits │ ├── ContainerTraits.h │ ├── CopyTraits.h │ ├── CtorDtor.h │ ├── DefaultValue.h │ ├── Dereferencer.h │ ├── EnumIntType.h │ ├── FunctionTypeToFunctionPointerType.h │ ├── FunctionTypeToMethodPointerType.h │ ├── HasBinOp.h │ ├── HasEmbeddedRtti.h │ ├── HasEq.h │ ├── HasField.h │ ├── HasGreater.h │ ├── HasLess.h │ ├── HasMember.h │ ├── HasMethod.h │ ├── HasMethodNoBase.h │ ├── HasReflection.h │ ├── HasStaticFunction.h │ ├── HasVirtualDestructor.h │ ├── HasXXX.h │ ├── ImplicitConv.h │ ├── IntTypeBySize.h │ ├── IsComplete.h │ ├── IsDataPointer.h │ ├── IsDefaultConstructible.h │ ├── IsDefinedInContext.h │ ├── IsEnumClass.h │ ├── IsFunctionPointer.h │ ├── IsNullptrT.h │ ├── IsStructure.h │ ├── IsTemplate.h │ ├── IsTypeDefined.h │ ├── IsVirtualBaseOf.h │ ├── IsVoid.h │ ├── MemberPointerMaker.h │ ├── ModifiersAndFlags.h │ ├── MoveArg.h │ ├── MoveTraits.h │ ├── MovedValue.h │ ├── Promote.h │ ├── ReferenceToPointer.h │ ├── RemoveAllPointers.h │ ├── RemoveConstReference.h │ ├── RemoveEveything.h │ ├── SafeAlignOf.h │ ├── SafeSizeOf.h │ ├── SelectType.h │ ├── SimplifiedType.h │ ├── TypeIdentity.h │ ├── VTableTraits.h │ ├── indices.h │ └── prerequisites.h ├── typedef ├── typeof ├── union ├── unionof ├── using ├── utils │ ├── ArrayView.h │ ├── ArrayView.hxx │ ├── ArrayView.hxx.cpp │ ├── CallStackTrace.cpp │ ├── CallStackTrace.h │ ├── CallStackTrace.hxx │ ├── CallStackTrace.hxx.cpp │ ├── Console.cpp │ ├── Console.h │ ├── Delegate.cpp │ ├── Delegate.h │ ├── Delegate.hxx │ ├── Delegate.hxx.cpp │ ├── DynDelegate.cpp │ ├── DynDelegate.h │ ├── DynDelegate.hxx │ ├── DynDelegate.hxx.cpp │ ├── Factory.h │ ├── Flags.cpp │ ├── Flags.h │ ├── Flags.hxx │ ├── Flags.hxx.cpp │ ├── ForwardHeap.cpp │ ├── ForwardHeap.h │ ├── ForwardHeap.hxx │ ├── ForwardHeap.hxx.cpp │ ├── Functor.h │ ├── Functor.hxx │ ├── Functor.hxx.cpp │ ├── FunctorID.h │ ├── FunctorID.hxx │ ├── FunctorID.hxx.cpp │ ├── Generic.h │ ├── Generic.hxx │ ├── Generic.hxx.cpp │ ├── History.cpp │ ├── History.h │ ├── History.hxx │ ├── History.hxx.cpp │ ├── LexicalCast.h │ ├── MemorySentry.cpp │ ├── MemorySentry.h │ ├── Object.cpp │ ├── Object.h │ ├── Object.hxx │ ├── Object.hxx.cpp │ ├── Optional.h │ ├── Optional.hxx │ ├── Optional.hxx.cpp │ ├── OptionalArrayView.h │ ├── OptionalArrayView.hxx │ ├── OptionalArrayView.hxx.cpp │ ├── Pair.h │ ├── Pair.hxx │ ├── Pair.hxx.cpp │ ├── Path.cpp │ ├── Path.h │ ├── Path.hxx │ ├── Path.hxx.cpp │ ├── Placement.h │ ├── Placement.hxx │ ├── Placement.hxx.cpp │ ├── Property.h │ ├── RTTI.h │ ├── ScopeExit.h │ ├── Signal.cpp │ ├── Signal.h │ ├── Signal.hxx │ ├── Signal.hxx.cpp │ ├── SmallMap.h │ ├── SmallMap.hxx │ ├── SmallMap.hxx.cpp │ ├── SmallMultimap.h │ ├── SmallMultimap.hxx │ ├── SmallMultimap.hxx.cpp │ ├── SmallSet.h │ ├── SmallSet.hxx │ ├── SmallSet.hxx.cpp │ ├── SmallString.h │ ├── SmallString.hxx │ ├── SmallString.hxx.cpp │ ├── SmallVector.cpp │ ├── SmallVector.h │ ├── SmallVector.hxx │ ├── SmallVector.hxx.cpp │ ├── SmallVector.soul │ ├── SmallVectorBasedContainer.h │ ├── SmallVectorBasedContainer.hxx │ ├── SmallVectorBasedContainer.hxx.cpp │ ├── StaticIf.h │ ├── String.h │ ├── String.hxx │ ├── String.hxx.cpp │ ├── StringBuffer.h │ ├── StringHash.cpp │ ├── StringHash.h │ ├── StringHash.hxx │ ├── StringHash.hxx.cpp │ ├── StringUtil.cpp │ ├── StringUtil.h │ ├── StringUtil.hxx │ ├── StringUtil.hxx.cpp │ ├── StringView.h │ ├── StringView.hxx │ ├── StringView.hxx.cpp │ ├── StringViews.h │ ├── StringWithHash.h │ ├── StringWithHash.hxx │ ├── StringWithHash.hxx.cpp │ ├── Variant.cpp │ ├── Variant.h │ ├── Variant.hxx │ ├── Variant.hxx.cpp │ ├── Variant.inl │ ├── VariantT.h │ ├── VariantT.hxx │ ├── VariantT.hxx.cpp │ ├── crc64.cpp │ ├── crc64.h │ ├── crc64.hxx │ ├── crc64.hxx.cpp │ ├── random.cpp │ ├── random.h │ ├── random.hxx │ └── random.hxx.cpp └── variable └── std ├── initializer_list.h ├── initializer_list.hxx ├── initializer_list.hxx.cpp ├── numeric_limits.hxx └── numeric_limits.hxx.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | /build/** 2 | /projects/Phantom.Code 3 | /projects/phantom.state 4 | /projects/phantom.serialization 5 | /projects/llvmjit 6 | /projects/soul 7 | /projects/fcontext 8 | /projects/spell 9 | /tools/haunt.exe 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2021 Vivien MILLET 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Premake-vs2015.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | external\bin\premake5.exe --file=premake/static.lua vs2015 [LinkLibraryDependencies] 3 | if %ERRORLEVEL% NEQ 0 PAUSE -------------------------------------------------------------------------------- /Premake-vs2017.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | premake\premake5.exe --file=Phantom.lua vs2017 3 | if %ERRORLEVEL% NEQ 0 PAUSE -------------------------------------------------------------------------------- /Premake-vs2019.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | premake\premake5.exe --file=Phantom.lua vs2019 3 | if %ERRORLEVEL% NEQ 0 PAUSE -------------------------------------------------------------------------------- /premake/premake5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlmillet/Phantom/e5579ea52dafded64fd2fe88aabfdf8a73534918/premake/premake5 -------------------------------------------------------------------------------- /premake/premake5.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlmillet/Phantom/e5579ea52dafded64fd2fe88aabfdf8a73534918/premake/premake5.exe -------------------------------------------------------------------------------- /projects/HelloWorld/HelloWorld.premake.lua: -------------------------------------------------------------------------------- 1 | 2 | Phantom_console_app("HelloWorld", { "Phantom" } -- DEPENDENCIES 3 | , 4 | function(Vars) -- include private 5 | 6 | end 7 | , 8 | function(Vars) -- link 9 | filter {} 10 | end 11 | 12 | ) 13 | -------------------------------------------------------------------------------- /projects/Phantom/Phantom.pch.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | 8 | #include "phantom.pch.h" -------------------------------------------------------------------------------- /projects/Phantom/Phantom.pch.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | -------------------------------------------------------------------------------- /projects/Phantom/Phantom.premake.lua: -------------------------------------------------------------------------------- 1 | 2 | Phantom_lib("Phantom", { } -- DEPENDENCIES 3 | , 4 | function(Vars) -- include public 5 | filter {"toolset:msc"} 6 | buildoptions { "/vmg /vmv" } 7 | filter {} 8 | 9 | if(Vars["Link"] == "Static") then 10 | defines { "PHANTOM_STATIC_LINK_PHANTOM" } 11 | end 12 | 13 | end 14 | , 15 | function(Vars) -- include private 16 | defines 17 | { 18 | "PHANTOM_LIB_PHANTOM", 19 | "_CRT_SECURE_NO_WARNINGS" 20 | } 21 | 22 | files { "./natvis/Phantom.natvis" } 23 | 24 | Phantom_pch() 25 | 26 | filter {} 27 | 28 | local hauntParams = {} 29 | hauntParams["IsHaunted"] = true 30 | Phantom_plugin("Phantom", Vars, hauntParams) 31 | 32 | end 33 | , 34 | function(Vars) -- link 35 | filter { "platforms:Win32 or x64" } 36 | links { 37 | "DbgHelp.lib" 38 | } 39 | 40 | filter {} 41 | end 42 | 43 | ) 44 | -------------------------------------------------------------------------------- /projects/Phantom/haunt: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2015-2016 Vivien Millet. 3 | // Distributed under the Lesser GNU Lesser General Public License, Version 3.0. (See 4 | // the LICENSE file which comes along with this source code or a copy at 5 | // http://www.wiwila.com/tools/phantom/license/) 6 | // ] 7 | 8 | #pragma once 9 | 10 | #include "phantom/haunt.h" 11 | -------------------------------------------------------------------------------- /projects/Phantom/haunt.bind: -------------------------------------------------------------------------------- 1 | std::initializer_list=std/initializer_list.hxx 2 | std::numeric_limits=std/numeric_limits.hxx 3 | ptrdiff_t= 4 | intptr_t= 5 | uintptr_t= 6 | size_t= 7 | std::size_t= 8 | std::ptrdiff_t= 9 | std::intptr_t= 10 | std::uintptr_t= 11 | std::nullptr_t= 12 | int8_t= 13 | int16_t= 14 | int32_t= 15 | int64_t= 16 | uint8_t= 17 | uint16_t= 18 | uint32_t= 19 | uint64_t= 20 | phantom::size_t= 21 | phantom::uint= 22 | phantom::float32= 23 | phantom::float64= 24 | phantom::int8= 25 | phantom::int16= 26 | phantom::int32= 27 | phantom::int64= 28 | phantom::uint8= 29 | phantom::uint16= 30 | phantom::uint32= 31 | phantom::uint64= 32 | phantom::sint8= 33 | phantom::sint16= 34 | phantom::sint32= 35 | phantom::sint64= 36 | phantom::longlong= 37 | phantom::uchar= 38 | phantom::ushort= 39 | phantom::uint= 40 | phantom::ulong= 41 | phantom::ulonglong= 42 | phantom::schar= 43 | phantom::sshort= 44 | phantom::sint= 45 | phantom::slong= 46 | phantom::slonglong= 47 | phantom::wchar= 48 | phantom::character= 49 | phantom::longdouble= 50 | phantom::boolean= 51 | phantom::size_t= 52 | phantom::byte= 53 | phantom::sreal= 54 | phantom::dreal= 55 | phantom::real= 56 | phantom::MessageType= -------------------------------------------------------------------------------- /projects/Phantom/haunt.ignore: -------------------------------------------------------------------------------- 1 | /phantom/traits 2 | /phantom/detail 3 | /std -------------------------------------------------------------------------------- /projects/Phantom/phantom/CustomAllocator.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | namespace phantom 13 | { 14 | struct PHANTOM_EXPORT_PHANTOM CustomAllocator 15 | { 16 | // User must call these for pushing its own allocators 17 | static void Push(CustomAllocator a_func); 18 | static void Pop(); 19 | 20 | static CustomAllocator const& CurrentOrDefault(); 21 | static CustomAllocator const& Current(); 22 | static CustomAllocator const& Default(); 23 | static void Init(); 24 | static void Release(); 25 | 26 | using AllocFunc = Delegate; 27 | using ReallocFunc = Delegate; 28 | using DeallocFunc = Delegate; 29 | 30 | AllocFunc allocFunc; 31 | DeallocFunc deallocFunc; 32 | ReallocFunc reallocFunc; 33 | 34 | bool operator==(CustomAllocator const& o) const 35 | { 36 | return (allocFunc == o.allocFunc && deallocFunc == o.deallocFunc && reallocFunc == o.reallocFunc); 37 | } 38 | }; 39 | } // namespace phantom 40 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/CustomAllocator.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "CustomAllocator.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/UserData.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | namespace phantom 13 | { 14 | struct PHANTOM_EXPORT_PHANTOM UserData 15 | { 16 | UserData() = default; 17 | UserData(void* a_pData, Delegate a_Destroy) : m_pData(a_pData), m_Destroy(a_Destroy) 18 | { 19 | PHANTOM_ASSERT(a_pData && m_Destroy); 20 | } 21 | UserData(UserData const&) = delete; 22 | UserData& operator=(UserData const&) = delete; 23 | UserData(UserData&& a_Temp) : m_pData(a_Temp.m_pData), m_Destroy(a_Temp.m_Destroy) 24 | { 25 | a_Temp.m_pData = nullptr; 26 | } 27 | UserData& operator=(UserData&& a_Temp) 28 | { 29 | m_pData = a_Temp.m_pData; 30 | m_Destroy = a_Temp.m_Destroy; 31 | a_Temp.m_pData = nullptr; 32 | return *this; 33 | } 34 | ~UserData() 35 | { 36 | if (m_pData) 37 | m_Destroy(m_pData); 38 | } 39 | 40 | void* getData() const 41 | { 42 | return m_pData; 43 | } 44 | 45 | private: 46 | void* m_pData = nullptr; 47 | Delegate m_Destroy; 48 | }; 49 | } // namespace phantom 50 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/UserData.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "UserData.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/alias: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/alias_template: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/alignof: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #if PHANTOM_COMPILER == PHANTOM_COMPILER_VISUAL_STUDIO && PHANTOM_COMPILER_MAJOR_VERSION <= PHANTOM_COMPILER_VISUAL_STUDIO_MAJOR_VERSION_14 6 | #include 7 | #define PHANTOM_ALIGNOF(...) (phantom::SafeAlignOf<__VA_ARGS__>::value) 8 | #else 9 | #define PHANTOM_ALIGNOF(...) alignof(__VA_ARGS__) 10 | #endif 11 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/allocate: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /projects/Phantom/phantom/assert.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/class: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/classof: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/constant: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/constructor: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | #include 8 | 9 | #define PHANTOM_CONSTRUCTOR(Parms, ...) (this_()).constructor() 10 | #define PHANTOM_T_CONSTRUCTOR(Parms, ...) (this_()). PHANTOM_T constructor() -------------------------------------------------------------------------------- /projects/Phantom/phantom/customize.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlmillet/Phantom/e5579ea52dafded64fd2fe88aabfdf8a73534918/projects/Phantom/phantom/customize.h -------------------------------------------------------------------------------- /projects/Phantom/phantom/deallocate: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /projects/Phantom/phantom/default_value: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /projects/Phantom/phantom/detail/ClassOfFwd.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #define PHANTOM_CLASSOF(...) _PHNTM_TYPEOF_CHECK(class, Class, __VA_ARGS__) 12 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/detail/EnumOfFwd.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #define PHANTOM_ENUMOF(...) _PHNTM_TYPEOF_CHECK(enum, Enum, __VA_ARGS__) 12 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/detail/Hasher.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | HAUNT_STOP 12 | 13 | namespace phantom 14 | { 15 | template 16 | struct Hasher 17 | { 18 | static uint64_t apply(const T* a_pInstance) 19 | { 20 | return crc64(0, reinterpret_cast(a_pInstance), sizeof(T)); 21 | } 22 | }; 23 | } // namespace phantom 24 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/detail/LambdaCapture.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace phantom 12 | { 13 | template 14 | class LambdaCaptureImpl 15 | { 16 | T x; 17 | F f; 18 | 19 | public: 20 | LambdaCaptureImpl(T&& x, F&& f) : x{std::forward(x)}, f{std::forward(f)} 21 | { 22 | } 23 | 24 | template 25 | auto operator()(Ts&&... args) -> decltype(f(x, std::forward(args)...)) 26 | { 27 | return f(x, std::forward(args)...); 28 | } 29 | 30 | template 31 | auto operator()(Ts&&... args) const -> decltype(f(x, std::forward(args)...)) 32 | { 33 | return f(x, std::forward(args)...); 34 | } 35 | }; 36 | 37 | template 38 | LambdaCaptureImpl LambdaCapture(T&& x, F&& f) 39 | { 40 | return LambdaCaptureImpl(std::forward(x), std::forward(f)); 41 | } 42 | } // namespace phantom 43 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/detail/MemoryContext.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "MemoryContext.h" 8 | 9 | namespace phantom 10 | { 11 | MemoryContext::~MemoryContext() 12 | { 13 | for (auto pPtr : m_Allocations) 14 | { 15 | phantom::deallocate(pPtr); 16 | } 17 | } 18 | 19 | void MemoryContext::registerMemory(void* a_pPtr) 20 | { 21 | PHANTOM_VERIFY(m_Allocations.insert(a_pPtr).second); 22 | } 23 | 24 | void MemoryContext::unregisterMemory(void* a_pPtr) 25 | { 26 | PHANTOM_VERIFY(m_Allocations.erase(a_pPtr) == 1); 27 | } 28 | 29 | } // namespace phantom 30 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/detail/MemoryContext.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /* ****************** Includes ******************* */ 10 | #include 11 | HAUNT_STOP; 12 | #include 13 | #include 14 | /* *********************************************** */ 15 | namespace phantom 16 | { 17 | class PHANTOM_EXPORT_PHANTOM MemoryContext 18 | { 19 | public: 20 | ~MemoryContext(); 21 | void registerMemory(void* a_pPtr); 22 | void unregisterMemory(void* a_pPtr); 23 | 24 | private: 25 | SmallSet m_Allocations; 26 | }; 27 | } // namespace phantom 28 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/detail/Registrer.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "core.h" 10 | 11 | #include 12 | 13 | namespace phantom 14 | { 15 | using Registrer = phantom::Delegate; 16 | } 17 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/detail/TypeInstallationInfo.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | HAUNT_STOP; 12 | 13 | #include "Registrer.h" 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | namespace phantom 21 | { 22 | namespace lang 23 | { 24 | using TypeInstallFunc = Delegate; 25 | 26 | struct PHANTOM_EXPORT_PHANTOM TypeInstallationInfo 27 | { 28 | TypeInstallationInfo() = default; 29 | // TypeInstallationInfo(lang::Type* a_pType, lang::Source* a_pSource, 30 | // TypeInstallFunc a_setupFunc, lang::SymbolExtenders&& a_Exts); 31 | TypeInstallationInfo(lang::Type* a_pType, lang::Source* a_pSource, TypeInstallFunc a_setupFunc); 32 | void exec(TypeInstallationStep step); 33 | void installSymbolExtenders(); 34 | TypeInstallFunc installFunc; 35 | lang::Type* type; 36 | lang::Source* m_pSource; 37 | uint steps; 38 | // lang::SymbolExtenders extenders; 39 | }; 40 | 41 | } // namespace lang 42 | } // namespace phantom 43 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/detail/UnionOfFwd.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #define PHANTOM_UNIONOF(...) _PHNTM_TYPEOF_CHECK(union, Union, __VA_ARGS__) 12 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/detail/memory.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | HAUNT_STOP; 13 | 14 | #include 15 | #include 16 | 17 | namespace phantom 18 | { 19 | PHANTOM_EXPORT_PHANTOM void* allocate(size_t size, size_t align = 1); 20 | PHANTOM_EXPORT_PHANTOM void deallocate(void* mem); 21 | PHANTOM_EXPORT_PHANTOM void* reallocate(void* mem, size_t size, size_t align = 1); 22 | 23 | } // namespace phantom 24 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/detail/typedefs.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "typedefs.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/enum: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/enum_class: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/enumof: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/field: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/friend: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/function: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/fwd.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // haunt { 4 | 5 | // clang-format off 6 | 7 | #include "fwd.h" 8 | 9 | #if defined(_MSC_VER) 10 | # pragma warning(push, 0) 11 | #elif defined(__clang__) 12 | # pragma clang diagnostic push 13 | # pragma clang diagnostic ignored "-Wall" 14 | # pragma clang diagnostic ignored "-Wextra" 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | #include "utils/SmallVector.hxx" 27 | 28 | #include 29 | 30 | namespace phantom { 31 | PHANTOM_PACKAGE("phantom") 32 | PHANTOM_SOURCE("fwd") 33 | 34 | #if PHANTOM_NOT_TEMPLATE 35 | PHANTOM_STRUCT(NullMutex) 36 | { 37 | this_() 38 | .method("lock", &_::lock) 39 | .method("unlock", &_::unlock) 40 | .method("try_lock", &_::try_lock) 41 | .method("autoLock", &_::autoLock) 42 | ; 43 | } 44 | PHANTOM_REGISTER(Typedefs) { this_().typedef_("Variants"); } 45 | #endif // PHANTOM_NOT_TEMPLATE 46 | PHANTOM_END("fwd") 47 | PHANTOM_END("phantom") 48 | } 49 | 50 | #if defined(_MSC_VER) 51 | # pragma warning(pop) 52 | #elif defined(__clang__) 53 | # pragma clang diagnostic pop 54 | #endif 55 | 56 | // clang-format on 57 | 58 | // haunt } 59 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/fwd.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "fwd.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Aggregate.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Aggregate.h" 8 | 9 | #include 10 | 11 | namespace phantom 12 | { 13 | namespace lang 14 | { 15 | void Aggregate::getFlattenedFields(AggregateFields& _flattenedfields) const 16 | { 17 | AggregateFields notFlattened; 18 | getFields(notFlattened); 19 | for (auto& f : notFlattened) 20 | { 21 | size_t i = _flattenedfields.size(); 22 | if (f.type != nullptr) 23 | { 24 | f.type->getFlattenedAggregateFields(_flattenedfields); 25 | for (; i < _flattenedfields.size(); ++i) 26 | { 27 | _flattenedfields[i].offset += f.offset; 28 | } 29 | } 30 | else 31 | { 32 | _flattenedfields.push_back(f); 33 | } 34 | } 35 | } 36 | 37 | Type* Aggregate::asType() const 38 | { 39 | return m_pThisType; 40 | } 41 | Class* Aggregate::asClass() const 42 | { 43 | return m_pThisType->asClass(); 44 | } 45 | Array* Aggregate::asArray() const 46 | { 47 | return m_pThisType->asArray(); 48 | } 49 | 50 | } // namespace lang 51 | } // namespace phantom 52 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Aggregate.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /* ****************** Includes ******************* */ 10 | #include "reflection_fwd.h" 11 | /* **************** Declarations ***************** */ 12 | /* *********************************************** */ 13 | namespace phantom 14 | { 15 | namespace lang 16 | { 17 | struct AggregateField 18 | { 19 | Type* type = nullptr; 20 | size_t offset = 0; 21 | }; 22 | 23 | using AggregateFields = SmallVector; 24 | 25 | class PHANTOM_EXPORT_PHANTOM Aggregate 26 | { 27 | protected: 28 | Aggregate(Type* a_pThisType) : m_pThisType(a_pThisType) {} 29 | 30 | public: 31 | virtual void getFields(AggregateFields& _fields) const = 0; 32 | void getFlattenedFields(AggregateFields& _flattenedfields) const; 33 | 34 | Type* asType() const; 35 | Class* asClass() const; 36 | Array* asArray() const; 37 | 38 | private: 39 | Type* m_pThisType = nullptr; 40 | }; 41 | } // namespace lang 42 | } // namespace phantom 43 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Aggregate.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Aggregate.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Alias.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Alias.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Alias); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/AnonymousSection.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "AnonymousSection.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(AnonymousSection); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/AnonymousStruct.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "AnonymousStruct.h" 9 | /* *********************************************** */ 10 | namespace phantom 11 | { 12 | namespace lang 13 | { 14 | AnonymousStruct::AnonymousStruct(Modifiers modifiers /*= 0*/, uint a_uiFlags /*= 0*/) 15 | : AnonymousSection(modifiers, a_uiFlags) 16 | { 17 | } 18 | 19 | } // namespace lang 20 | } // namespace phantom 21 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/AnonymousStruct.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /* ****************** Includes ******************* */ 10 | #include 11 | /* **************** Declarations ***************** */ 12 | 13 | /* *********************************************** */ 14 | 15 | namespace phantom 16 | { 17 | namespace lang 18 | { 19 | //////////////////////////////////////////////////////////////////////////////////////////////////// 20 | /// \class AnonymousStruct 21 | /// 22 | /// \brief Represents a namespace level anonymous struct. ex: namespace [] { struct { int 23 | /// x; int y; } GlobalStruct; } 24 | //////////////////////////////////////////////////////////////////////////////////////////////////// 25 | 26 | class PHANTOM_EXPORT_PHANTOM AnonymousStruct : public AnonymousSection 27 | { 28 | PHANTOM_DECLARE_META_CLASS(AnonymousStruct); 29 | 30 | public: 31 | AnonymousStruct(Modifiers modifiers = 0, uint a_uiFlags = 0); 32 | 33 | AnonymousStruct* asAnonymousStruct() const override 34 | { 35 | return (AnonymousStruct*)this; 36 | } 37 | }; 38 | 39 | } // namespace lang 40 | } // namespace phantom 41 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/AnonymousStruct.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "AnonymousStruct.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(AnonymousStruct); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/AnonymousUnion.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "AnonymousUnion.h" 9 | /* *********************************************** */ 10 | namespace phantom 11 | { 12 | namespace lang 13 | { 14 | AnonymousUnion::AnonymousUnion(Modifiers modifiers /*= 0*/, uint a_uiFlags /*= 0*/) 15 | : AnonymousSection(modifiers, a_uiFlags) 16 | { 17 | } 18 | 19 | } // namespace lang 20 | } // namespace phantom 21 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/AnonymousUnion.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /* ****************** Includes ******************* */ 10 | #include 11 | /* **************** Declarations ***************** */ 12 | 13 | /* *********************************************** */ 14 | 15 | namespace phantom 16 | { 17 | namespace lang 18 | { 19 | //////////////////////////////////////////////////////////////////////////////////////////////////// 20 | /// \class AnonymousUnion 21 | /// 22 | /// \brief Represents a namespace level anonymous union. ex: namespace [] { union { int 23 | /// x; int y; } GlobalUnion; } 24 | //////////////////////////////////////////////////////////////////////////////////////////////////// 25 | 26 | class PHANTOM_EXPORT_PHANTOM AnonymousUnion : public AnonymousSection 27 | { 28 | PHANTOM_DECLARE_META_CLASS(AnonymousUnion); 29 | 30 | public: 31 | AnonymousUnion(Modifiers modifiers = 0, uint a_uiFlags = 0); 32 | 33 | AnonymousUnion* asAnonymousUnion() const override 34 | { 35 | return (AnonymousUnion*)this; 36 | } 37 | }; 38 | 39 | } // namespace lang 40 | } // namespace phantom 41 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/AnonymousUnion.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "AnonymousUnion.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(AnonymousUnion); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Application.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Application.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Application); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Array.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Array.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Array); 14 | } 15 | } // namespace phantom 16 | 17 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/ArrayClass.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "ArrayClass.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(ArrayClass) 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Callable.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "Callable.h" 9 | /* *********************************************** */ 10 | namespace phantom 11 | { 12 | namespace lang 13 | { 14 | } // namespace lang 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Callable.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /* ****************** Includes ******************* */ 10 | #include 11 | /* **************** Declarations ***************** */ 12 | 13 | /* *********************************************** */ 14 | 15 | namespace phantom 16 | { 17 | namespace lang 18 | { 19 | class PHANTOM_EXPORT_PHANTOM Callable 20 | { 21 | public: 22 | virtual void call(void** a_pArgs) const = 0; 23 | virtual void call(void** a_pArgs, void* a_pReturnAddress) const = 0; 24 | virtual void invoke(void* a_pThis, void** a_pArgs) const = 0; 25 | virtual void invoke(void* a_pThis, void** a_pArgs, void* a_pReturnAddress) const = 0; 26 | virtual uint64_t getUniqueID() const = 0; 27 | virtual void saveArgs(void** a_pArgs, SmallVector& a_variants) const = 0; 28 | virtual void onDisconnect() {} 29 | }; 30 | 31 | } // namespace lang 32 | } // namespace phantom 33 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Callable.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Callable.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Class.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlmillet/Phantom/e5579ea52dafded64fd2fe88aabfdf8a73534918/projects/Phantom/phantom/lang/Class.h -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Class.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | // PHANTOM_STATIC_ASSERT((std::is_same::type>::value)); 9 | // PHANTOM_STATIC_ASSERT(std::is_polymorphic::value); 10 | // PHANTOM_STATIC_ASSERT(!phantom::HasNewVTable::value); 11 | 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | } 17 | } // namespace phantom 18 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/ClassType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "ClassType.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(ClassType); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/CodeLocation.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "CodeLocation.h" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | } // namespace lang 14 | } // namespace phantom 15 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/CodeLocation.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "CodeLocation.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/ConstType.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlmillet/Phantom/e5579ea52dafded64fd2fe88aabfdf8a73534918/projects/Phantom/phantom/lang/ConstType.cpp -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/ConstType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "ConstType.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(ConstType); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/ConstVolatileType.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlmillet/Phantom/e5579ea52dafded64fd2fe88aabfdf8a73534918/projects/Phantom/phantom/lang/ConstVolatileType.cpp -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/ConstVolatileType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "ConstVolatileType.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(ConstVolatileType); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Constant.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Constant.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Constant); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Constructor.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "Constructor.h" 9 | 10 | #include "Parameter.h" 11 | /* *********************************************** */ 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | Constructor::Constructor() : Method(ABI::MethodCall) {} 17 | 18 | Constructor::Constructor(StringView a_strName, Signature* a_pSignature, Modifiers a_Modifiers /*= 0*/, 19 | uint a_uiFlags /*= 0*/) 20 | : Method(a_strName, a_pSignature, ABI::MethodCall, a_Modifiers, a_uiFlags) 21 | { 22 | } 23 | 24 | } // namespace lang 25 | } // namespace phantom 26 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Constructor.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Constructor.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Constructor); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/ContainerClass.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "ContainerClass.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(ContainerClass); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/CppSymbolParser.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /* ****************** Includes ******************* */ 10 | #include 11 | /* *********************************************** */ 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | struct PHANTOM_EXPORT_PHANTOM CppSymbolParser 17 | { 18 | Symbol* parse(StringView a_Text, LanguageElement* a_pScope, 19 | StringBuffer* a_pLastError = nullptr); 20 | bool parse(StringView a_Text, Symbols& a_Symbols, LanguageElement* a_pScope, 21 | StringBuffer* a_pLastError = nullptr); 22 | 23 | private: 24 | StringBuffer m_LastError; 25 | }; 26 | } // namespace lang 27 | } // namespace phantom 28 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/CppSymbolParser.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "CppSymbolParser.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/DataElement.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "DataElement.h" 9 | /* *********************************************** */ 10 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/DataElement.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /* ****************** Includes ******************* */ 10 | #include 11 | /* ************* Class Declarations ************** */ 12 | /* *********************************************** */ 13 | 14 | namespace phantom 15 | { 16 | namespace lang 17 | { 18 | class PHANTOM_EXPORT_PHANTOM DataElement 19 | { 20 | public: 21 | virtual size_t getAlignment() const = 0; 22 | virtual size_t getSize() const = 0; 23 | virtual size_t getOffset() const = 0; 24 | virtual void setOffset(size_t a_uiOffset) = 0; 25 | virtual void fetchFields(Fields& a_Out) const = 0; 26 | 27 | Symbol* asSymbol() const { return m_pThisElement; } 28 | 29 | protected: 30 | DataElement(Symbol* a_pThis) : m_pThisElement(a_pThis) {} 31 | 32 | private: 33 | Symbol* m_pThisElement; 34 | }; 35 | } // namespace lang 36 | } // namespace phantom 37 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/DataElement.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "DataElement.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/DataMember.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Field.h" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/DataMember.hxx: -------------------------------------------------------------------------------- 1 | #include "Field.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Destructor.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "Destructor.h" 9 | /* *********************************************** */ 10 | namespace phantom 11 | { 12 | namespace lang 13 | { 14 | Destructor::Destructor(StringView a_strName, Signature* a_pSignature, Modifiers a_Modifiers /*= 0*/, 15 | uint a_uiFlags /*= 0*/) 16 | : Method(a_strName, a_pSignature, a_Modifiers, a_uiFlags) 17 | { 18 | } 19 | 20 | } // namespace lang 21 | } // namespace phantom 22 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Destructor.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Destructor.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Destructor); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Enum.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Enum.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Enum); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/ExecutionContext.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "ExecutionContext.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/ExtendedType.hxx.cpp: -------------------------------------------------------------------------------- 1 | #include "ExtendedType.hxx" 2 | 3 | namespace phantom 4 | { 5 | namespace lang 6 | { 7 | PHANTOM_DEFINE_META_CLASS(ExtendedType); 8 | } 9 | } // namespace phantom 10 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Field.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Field.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Field); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/FieldPointer.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "FieldPointer.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(FieldPointer); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Function.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "Function.h" 9 | 10 | #include "Parameter.h" 11 | #include "Signature.h" 12 | 13 | /* *********************************************** */ 14 | namespace phantom 15 | { 16 | namespace lang 17 | { 18 | Function::Function(StringView a_strName, ABI a_eABI, Modifiers a_Modifiers /*= 0*/, uint a_uiFlags /*= 0*/) 19 | : Subroutine(a_strName, a_eABI, a_Modifiers, a_uiFlags) 20 | { 21 | } 22 | 23 | Function::Function(StringView a_strName, Signature* a_pSignature, ABI a_eABI, Modifiers a_Modifiers /*= 0*/, 24 | uint a_uiFlags /*= 0*/) 25 | : Subroutine(a_strName, a_pSignature, a_eABI, a_Modifiers, a_uiFlags) 26 | { 27 | } 28 | 29 | Function::Function(StringView a_strName, Signature* a_pSignature, Modifiers a_Modifiers /*= 0*/, uint a_uiFlags /*= 0*/) 30 | : Subroutine(a_strName, a_pSignature, ABI::DefaultCall, a_Modifiers, a_uiFlags) 31 | { 32 | } 33 | 34 | } // namespace lang 35 | } // namespace phantom 36 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Function.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Function.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Function); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/FunctionPointer.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "FunctionPointer.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(FunctionPointer); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/FunctionType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "FunctionType.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(FunctionType); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/FunctorProperty.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "FunctorProperty.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Import.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "Import.h" 9 | 10 | #include "Source.h" 11 | /* *********************************************** */ 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | Import::Import(Source* a_pSource, StringView a_strSymbolName, Modifiers a_Modifiers /*= 0*/, uint a_uiFlags /*= 0*/) 17 | : Symbol(a_strSymbolName, a_Modifiers, a_uiFlags), m_pImportedSource(a_pSource) 18 | { 19 | } 20 | 21 | } // namespace lang 22 | } // namespace phantom 23 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Import.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Import.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Import); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/InitializerListType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "InitializerListType.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(InitializerListType); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/InstanceCache.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "InstanceCache.h" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | InstanceCache::InstanceCache(Class* a_pClass) : m_pClass(a_pClass) 14 | { 15 | PHANTOM_CONNECT(m_pClass, kindCreated, this, kindCreated); 16 | PHANTOM_CONNECT(m_pClass, kindDestroying, this, kindDestroying); 17 | PHANTOM_ASSERT(m_pClass->getInstanceCount() == 0, 18 | "instance cache cannot be created after an instance has already been created"); 19 | } 20 | 21 | InstanceCache::~InstanceCache() 22 | { 23 | PHANTOM_DISCONNECT(m_pClass, kindCreated, this, kindCreated); 24 | PHANTOM_DISCONNECT(m_pClass, kindDestroying, this, kindDestroying); 25 | } 26 | 27 | void InstanceCache::kindCreated(void* a_pInstance) 28 | { 29 | auto lock = m_Mutex.autoLock(); 30 | PHANTOM_ASSERT(std::find(m_Instances.begin(), m_Instances.end(), a_pInstance) == m_Instances.end()); 31 | m_Instances.push_back(a_pInstance); 32 | } 33 | 34 | void InstanceCache::kindDestroying(void* a_pInstance) 35 | { 36 | auto lock = m_Mutex.autoLock(); 37 | auto found = std::find(m_Instances.begin(), m_Instances.end(), a_pInstance); 38 | PHANTOM_ASSERT(found != m_Instances.end()); 39 | m_Instances.erase(found); 40 | } 41 | } // namespace lang 42 | } // namespace phantom 43 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/InstanceCache.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "InstanceCache.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/LValueReference.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "LValueReference.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(LValueReference); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/LanguageElement.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "LanguageElement.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(LanguageElement); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/LanguageElementVisitor.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "LanguageElementVisitor.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/LocalVariable.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "LocalVariable.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(LocalVariable); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MapClass.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "MapClass.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(MapClass); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MemberAnonymousSection.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "MemberAnonymousSection.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(MemberAnonymousSection); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MemberAnonymousStruct.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "MemberAnonymousStruct.h" 9 | 10 | #include "Type.h" 11 | /* *********************************************** */ 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | MemberAnonymousStruct::MemberAnonymousStruct(Modifiers modifiers /*= 0*/, uint a_uiFlags /*= 0*/) 17 | : MemberAnonymousSection(modifiers, a_uiFlags) 18 | { 19 | } 20 | 21 | void MemberAnonymousStruct::computeSizeAndAlignment(size_t& a_uiSize, size_t& a_uiAlignment) const 22 | { 23 | Type::AlignmentComputer().alignStruct(m_DataElements, a_uiSize, a_uiAlignment); 24 | } 25 | 26 | } // namespace lang 27 | } // namespace phantom 28 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MemberAnonymousStruct.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /* ****************** Includes ******************* */ 10 | #include 11 | /* **************** Declarations ***************** */ 12 | 13 | /* *********************************************** */ 14 | 15 | namespace phantom 16 | { 17 | namespace lang 18 | { 19 | /// \brief Represents a member anonymous struct. 20 | /// \code{.cpp} 21 | /// struct 22 | /// { 23 | /// int a; 24 | /// int b; 25 | /// }; 26 | /// \endcode 27 | class PHANTOM_EXPORT_PHANTOM MemberAnonymousStruct : public MemberAnonymousSection 28 | { 29 | PHANTOM_DECLARE_META_CLASS(MemberAnonymousStruct); 30 | 31 | public: 32 | MemberAnonymousStruct(Modifiers modifiers = 0, uint a_uiFlags = 0); 33 | 34 | MemberAnonymousStruct* asMemberAnonymousStruct() const override 35 | { 36 | return (MemberAnonymousStruct*)this; 37 | } 38 | 39 | protected: 40 | void computeSizeAndAlignment(size_t& a_uiSize, size_t& a_uiAlignment) const override; 41 | }; 42 | 43 | } // namespace lang 44 | } // namespace phantom 45 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MemberAnonymousStruct.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "MemberAnonymousStruct.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(MemberAnonymousStruct); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MemberAnonymousUnion.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "MemberAnonymousUnion.h" 9 | 10 | #include "Type.h" 11 | /* *********************************************** */ 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | MemberAnonymousUnion::MemberAnonymousUnion(Modifiers modifiers /*= 0*/, uint a_uiFlags /*= 0*/) 17 | : MemberAnonymousSection(modifiers, a_uiFlags) 18 | { 19 | } 20 | 21 | void MemberAnonymousUnion::computeSizeAndAlignment(size_t& a_uiSize, size_t& a_uiAlignment) const 22 | { 23 | Type::AlignmentComputer().alignUnion(m_DataElements, m_uiSize, m_uiAlignment); 24 | a_uiSize = m_uiSize; 25 | a_uiAlignment = m_uiSize; 26 | } 27 | 28 | } // namespace lang 29 | } // namespace phantom 30 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MemberAnonymousUnion.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /* ****************** Includes ******************* */ 10 | #include 11 | /* **************** Declarations ***************** */ 12 | 13 | /* *********************************************** */ 14 | 15 | namespace phantom 16 | { 17 | namespace lang 18 | { 19 | /// \brief Represents a member anonymous union. 20 | /// \code{.cpp} 21 | /// union 22 | /// { 23 | /// int a; 24 | /// int b; 25 | /// }; 26 | /// \endcode 27 | class PHANTOM_EXPORT_PHANTOM MemberAnonymousUnion : public MemberAnonymousSection 28 | { 29 | PHANTOM_DECLARE_META_CLASS(MemberAnonymousUnion); 30 | 31 | public: 32 | MemberAnonymousUnion(Modifiers modifiers = 0, uint a_uiFlags = 0); 33 | 34 | MemberAnonymousUnion* asMemberAnonymousUnion() const override 35 | { 36 | return (MemberAnonymousUnion*)this; 37 | } 38 | 39 | protected: 40 | void computeSizeAndAlignment(size_t& a_uiSize, size_t& a_uiAlignment) const override; 41 | }; 42 | 43 | } // namespace lang 44 | } // namespace phantom 45 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MemberAnonymousUnion.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "MemberAnonymousUnion.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(MemberAnonymousUnion); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MemberFunction.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Method.h" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MemberFunction.hxx: -------------------------------------------------------------------------------- 1 | #include "Method.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MemberPointer.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "MemberPointer.h" 9 | 10 | #include "ClassType.h" 11 | /* *********************************************** */ 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | MemberPointer::MemberPointer(TypeKind a_TypeId, ClassType* a_pObjectType, size_t a_uiSize, size_t a_uiAlignment, 17 | Modifiers a_Modifiers /*= 0*/, uint a_uiFlags /*= 0*/) 18 | : Type(a_TypeId, "", a_uiSize, a_uiAlignment, a_Modifiers, a_uiFlags), m_pObjectType(a_pObjectType) 19 | { 20 | if (m_pObjectType->isTemplateDependant()) 21 | setTemplateDependant(); 22 | } 23 | 24 | PHANTOM_DTOR MemberPointer::~MemberPointer() 25 | { 26 | } 27 | 28 | } // namespace lang 29 | } // namespace phantom 30 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MemberPointer.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "MemberPointer.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(MemberPointer); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MetaNewDelete.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | HAUNT_STOP; 12 | 13 | /// @endcond 14 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Method.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Method.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Method); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MethodBaseT.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | HAUNT_STOP; 12 | 13 | /// @cond INTERNAL 14 | 15 | /* ****************** Includes ******************* */ 16 | #include 17 | #include 18 | #include 19 | /* **************** Declarations ***************** */ 20 | /* *********************************************** */ 21 | namespace phantom 22 | { 23 | namespace lang 24 | { 25 | class MethodBaseT : public Method 26 | { 27 | public: 28 | MethodBaseT(StringView a_strName, Signature* a_pSignature, Modifiers a_Modifiers = 0, uint a_uiFlags = 0) 29 | : Method(a_strName, a_pSignature, a_Modifiers, a_uiFlags | PHANTOM_R_FLAG_NATIVE) 30 | { 31 | } 32 | }; 33 | 34 | } // namespace lang 35 | } // namespace phantom 36 | 37 | /// @endcond 38 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/MethodPointer.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "MethodPointer.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(MethodPointer); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Module.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Module.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Module); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Namespace.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | // #include "Namespace.hxx" (in Namespace.cpp) 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Package.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Package.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Package); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PackageFolder.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | // #include "PackageFolder.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Parameter.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Parameter.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Parameter); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Placeholder.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "Placeholder.h" 9 | /* *********************************************** */ 10 | namespace phantom 11 | { 12 | namespace lang 13 | { 14 | } // namespace lang 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Placeholder.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Placeholder.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PlaceholderClass.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "PlaceholderClass.h" 9 | 10 | #include "PlaceholderType.h" 11 | /* *********************************************** */ 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | PlaceholderClass::PlaceholderClass(PlaceholderType* a_pPlaceholderType) 17 | : PlaceholderClass(a_pPlaceholderType->getName(), a_pPlaceholderType->getModifiers(), 18 | a_pPlaceholderType->getFlags()) 19 | { 20 | } 21 | 22 | PlaceholderClass::PlaceholderClass(StringView a_Name, Modifiers a_Modifiers, uint a_Flags) 23 | : Class(a_Name, 0, 0, a_Modifiers, a_Flags | PHANTOM_R_FLAG_TEMPLATE_DEPENDANT) 24 | { 25 | } 26 | 27 | Placeholder* PlaceholderClass::clone(LanguageElement* a_pOwner, uint a_Flags) const 28 | { 29 | return a_pOwner->New(getName(), getModifiers(), a_Flags); 30 | } 31 | 32 | } // namespace lang 33 | } // namespace phantom 34 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PlaceholderClass.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "PlaceholderClass.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PlaceholderClassType.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "PlaceholderClassType.h" 9 | 10 | #include "PlaceholderType.h" 11 | /* *********************************************** */ 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | PlaceholderClassType::PlaceholderClassType(PlaceholderType* a_pPlaceholderType) 17 | : PlaceholderClassType(a_pPlaceholderType->getName(), a_pPlaceholderType->getModifiers(), 18 | a_pPlaceholderType->getFlags()) 19 | { 20 | } 21 | 22 | PlaceholderClassType::PlaceholderClassType(StringView a_Name, Modifiers a_Modifiers, uint a_Flags) 23 | : ClassType(TypeKind::ClassType, a_Name, 0, 0, a_Modifiers, a_Flags | PHANTOM_R_FLAG_TEMPLATE_DEPENDANT) 24 | { 25 | } 26 | 27 | Class* PlaceholderClassType::toClass() const 28 | { 29 | return ((PlaceholderType*)getOwner())->toClass(); 30 | } 31 | 32 | Placeholder* PlaceholderClassType::clone(LanguageElement* a_pOwner, uint a_Flags) const 33 | { 34 | return a_pOwner->New(getName(), getModifiers(), a_Flags); 35 | } 36 | 37 | } // namespace lang 38 | } // namespace phantom 39 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PlaceholderClassType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "PlaceholderClassType.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PlaceholderConstant.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "PlaceholderConstant.h" 9 | /* *********************************************** */ 10 | namespace phantom 11 | { 12 | namespace lang 13 | { 14 | bool PlaceholderConstant::accepts(LanguageElement* a_pLanguageElement) const 15 | { 16 | return a_pLanguageElement->removeExpression()->asConstant() != nullptr; 17 | } 18 | 19 | Constant* PlaceholderConstant::cloneImpl(LanguageElement* a_pOwner) const 20 | { 21 | return a_pOwner->New(getValueType(), getName(), getModifiers(), 0); 22 | } 23 | 24 | Placeholder* PlaceholderConstant::clone(LanguageElement* a_pOwner, uint a_Flags) const 25 | { 26 | return a_pOwner->New(getValueType(), getName(), getModifiers(), a_Flags); 27 | } 28 | 29 | } // namespace lang 30 | } // namespace phantom 31 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PlaceholderConstant.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "PlaceholderConstant.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(PlaceholderConstant); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PlaceholderTemplate.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "PlaceholderTemplate.h" 9 | 10 | #include "TemplateSignature.h" 11 | #include "TemplateSpecialization.h" 12 | /* *********************************************** */ 13 | namespace phantom 14 | { 15 | namespace lang 16 | { 17 | bool PlaceholderTemplate::accepts(LanguageElement* a_pLanguageElement) const 18 | { 19 | ClassType* pClassType = a_pLanguageElement->asClassType(); 20 | return pClassType && 21 | getTemplateSignature()->acceptsArguments(pClassType->getTemplateSpecialization()->getArguments()); 22 | } 23 | 24 | Placeholder* PlaceholderTemplate::clone(LanguageElement* a_pOwner, uint a_Flags /*= 0*/) const 25 | { 26 | return a_pOwner->New(getName(), getTemplateSignature()->clone(a_pOwner, a_Flags)); 27 | } 28 | 29 | } // namespace lang 30 | } // namespace phantom 31 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PlaceholderTemplate.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "PlaceholderTemplate.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PlaceholderType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "PlaceholderType.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(PlaceholderType); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Plugin.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Plugin.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Pointer.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Pointer.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Pointer); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PointerType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "PointerType.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(PointerType); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/PrimitiveType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "PrimitiveType.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(PrimitiveType); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Promoter.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | HAUNT_STOP; 13 | 14 | namespace phantom 15 | { 16 | namespace lang 17 | { 18 | namespace detail 19 | { 20 | template 21 | struct DefaultPromoterH 22 | { 23 | static lang::Type* apply(lang::Type*) 24 | { 25 | return PHANTOM_TYPEOF(PHANTOM_TYPENAME Promote::type); 26 | } 27 | }; 28 | template 29 | struct DefaultPromoterH 30 | { 31 | static lang::Type* apply(lang::Type* a_pType) 32 | { 33 | return a_pType; 34 | } 35 | }; 36 | } // namespace detail 37 | 38 | template 39 | struct Promoter : public detail::DefaultPromoterH::value> 40 | { 41 | }; 42 | } // namespace lang 43 | } // namespace phantom 44 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Property.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Property.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Property); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/QualifiedType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "QualifiedType.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(QualifiedType); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/RValueReference.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "RValueReference.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(RValueReference); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/RecursiveInstanceVisitorT.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "RecursiveInstanceVisitorT.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Reference.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "Reference.h" 9 | /* *********************************************** */ 10 | namespace phantom 11 | { 12 | namespace lang 13 | { 14 | } // namespace lang 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Reference.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Reference.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Reference); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Scope.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Scope.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/SequentialContainerClass.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SequentialContainerClass.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(SequentialContainerClass); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/SetClass.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SetClass.hxx" 8 | namespace phantom 9 | { 10 | namespace lang 11 | { 12 | PHANTOM_DEFINE_META_CLASS(SetClass); 13 | } 14 | } // namespace phantom 15 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Signature.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Signature.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Signature); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Source.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | // #include "Source.hxx" (in Application.cpp) 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/SourceFile.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SourceFile.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/SourceStream.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "SourceFile.h" 9 | #include "SourceStream.h" 10 | /* *********************************************** */ 11 | 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | phantom::lang::SourceStream* SourceStream::CreateFromUrl(StringView a_Url) 17 | { 18 | if (a_Url.find("file:") == 0) 19 | return SourceFile::CreateOnDisk(a_Url.substr(5), false); 20 | return nullptr; 21 | } 22 | 23 | } // namespace lang 24 | } // namespace phantom 25 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/SourceStream.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SourceStream.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/StaticField.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Variable.h" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/StaticField.hxx: -------------------------------------------------------------------------------- 1 | #include "Variable.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/StaticMethod.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Function.h" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/StaticMethod.hxx: -------------------------------------------------------------------------------- 1 | #include "Function.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/StaticVariable.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Variable.h" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/StaticVariable.hxx: -------------------------------------------------------------------------------- 1 | #include "Variable.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/StringClass.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "StringClass.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(StringClass); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Structure.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "Structure.h" 9 | 10 | #include "ValueMember.h" 11 | /* *********************************************** */ 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | Structure::Structure(StringView a_strName, Modifiers a_Modifiers /*= 0*/, uint a_uiFlags /*= 0*/) 17 | : ClassType(TypeKind::Structure, a_strName, a_Modifiers, a_uiFlags) 18 | { 19 | } 20 | 21 | Structure::Structure(StringView a_strName, size_t a_uiSize, size_t a_uiAlignment, Modifiers a_Modifiers /*= 0*/, 22 | uint a_uiFlags /*= 0*/) 23 | : ClassType(TypeKind::Structure, a_strName, a_uiSize, a_uiAlignment, a_Modifiers, a_uiFlags) 24 | { 25 | } 26 | 27 | void Structure::initialize() 28 | { 29 | ClassType::initialize(); 30 | if (!isNative()) 31 | setExtraData(new_()); 32 | } 33 | 34 | } // namespace lang 35 | } // namespace phantom 36 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Structure.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Structure.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Structure); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Subroutine.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlmillet/Phantom/e5579ea52dafded64fd2fe88aabfdf8a73534918/projects/Phantom/phantom/lang/Subroutine.cpp -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Subroutine.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Subroutine.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Subroutine); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Symbol.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Symbol.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Symbol); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Template.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Template.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Template); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/TemplateDependantArray.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "TemplateDependantArray.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/TemplateDependantElement.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "TemplateDependantElement.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(TemplateDependantElement); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/TemplateDependantTemplateInstance.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "TemplateDependantTemplateInstance.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/TemplateDependantType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "TemplateDependantType.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/TemplateParameter.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "TemplateParameter.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(TemplateParameter); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/TemplateSignature.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "TemplateSignature.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(TemplateSignature); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/TemplateSpecialization.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "TemplateSpecialization.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(TemplateSpecialization); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/TemplateSubstitution.hxx.cpp: -------------------------------------------------------------------------------- 1 | #include "TemplateSubstitution.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Type.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Type.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Type); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/TypeIndex.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "TypeIndex.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Undefineds.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Undefineds.h" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | Undefineds::Undefineds() 14 | : m_pPointerType(nullptr), 15 | m_pLValueReference(nullptr), 16 | m_pRValueReference(nullptr), 17 | m_pConstType(nullptr), 18 | m_pVolatileType(nullptr), 19 | m_pConstVolatileType(nullptr) 20 | { 21 | } 22 | 23 | Type* Undefineds::makePointer() 24 | { 25 | return m_pPointerType; 26 | } 27 | 28 | Type* Undefineds::makeLValueReference() 29 | { 30 | return m_pLValueReference; 31 | } 32 | 33 | Type* Undefineds::makeRValueReference() 34 | { 35 | return m_pRValueReference; 36 | } 37 | 38 | Type* Undefineds::makeConst() 39 | { 40 | return m_pConstType; 41 | } 42 | 43 | Type* Undefineds::makeVolatile() 44 | { 45 | return m_pVolatileType; 46 | } 47 | 48 | Type* Undefineds::makeConstVolatile() 49 | { 50 | return m_pConstVolatileType; 51 | } 52 | 53 | Type* Undefineds::makeArray(size_t s) 54 | { 55 | return m_Arrays[s]; 56 | } 57 | 58 | } // namespace lang 59 | } // namespace phantom 60 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Undefineds.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | namespace phantom 13 | { 14 | namespace lang 15 | { 16 | class PHANTOM_EXPORT_PHANTOM Undefineds 17 | { 18 | public: 19 | Undefineds(); 20 | Type* makePointer(); 21 | Type* makeLValueReference(); 22 | Type* makeRValueReference(); 23 | Type* makeConst(); 24 | Type* makeVolatile(); 25 | Type* makeConstVolatile(); 26 | Type* makeArray(size_t s); 27 | 28 | private: 29 | Type* m_pPointerType; 30 | Type* m_pLValueReference; 31 | Type* m_pRValueReference; 32 | Type* m_pConstType; 33 | Type* m_pVolatileType; 34 | Type* m_pConstVolatileType; 35 | SmallMap m_Arrays; 36 | }; 37 | } // namespace lang 38 | } // namespace phantom 39 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Undefineds.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Undefineds.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Union.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "Union.h" 9 | 10 | /* *********************************************** */ 11 | namespace phantom 12 | { 13 | namespace lang 14 | { 15 | Union::Union(StringView a_strName, Modifiers a_Modifiers /*= 0*/, uint a_uiFlags /*= 0*/) 16 | : ClassType(TypeKind::Union, a_strName, a_Modifiers, a_uiFlags) 17 | { 18 | } 19 | 20 | void Union::initialize() 21 | { 22 | ClassType::initialize(); 23 | if (!isNative()) 24 | setExtraData(new_()); 25 | } 26 | } // namespace lang 27 | } // namespace phantom 28 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Union.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Union.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Union); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/UnionT.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | HAUNT_STOP; 10 | 11 | #include 12 | #include 13 | 14 | namespace phantom 15 | { 16 | namespace lang 17 | { 18 | template 19 | class UnionT : public ClassTypeT 20 | { 21 | public: 22 | UnionT(StringView name) : ClassTypeT(name) 23 | { 24 | } 25 | }; 26 | 27 | template 28 | struct TypeOf > 29 | { 30 | static Type* object() 31 | { 32 | return Class::metaClass; 33 | } 34 | }; 35 | 36 | template 37 | struct MetaTypeOf > 38 | { 39 | typedef MetaTypeOf::type type; 40 | }; 41 | 42 | } // namespace lang 43 | } // namespace phantom 44 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/ValueMember.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "ValueMember.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(ValueMember); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/Variable.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Variable.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(Variable); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/VectorClass.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "VectorClass.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(VectorClass) 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/VirtualMethodTable.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "VirtualMethodTable.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(VirtualMethodTable); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/VolatileType.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "VolatileType.hxx" 8 | 9 | namespace phantom 10 | { 11 | namespace lang 12 | { 13 | PHANTOM_DEFINE_META_CLASS(VolatileType); 14 | } 15 | } // namespace phantom 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/reflection.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | // #include "lang.hxx" (in lang.cpp) 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/reflection_fwd.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "reflection_fwd.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/AliasTemplate.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // haunt { 4 | 5 | // clang-format off 6 | 7 | #include "AliasTemplate.h" 8 | 9 | #if defined(_MSC_VER) 10 | # pragma warning(push, 0) 11 | #elif defined(__clang__) 12 | # pragma clang diagnostic push 13 | # pragma clang diagnostic ignored "-Wall" 14 | # pragma clang diagnostic ignored "-Wextra" 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | #include 25 | 26 | #include 27 | 28 | namespace phantom { 29 | namespace lang { 30 | PHANTOM_PACKAGE("phantom.lang.registration") 31 | PHANTOM_SOURCE("AliasTemplate") 32 | 33 | #if PHANTOM_NOT_TEMPLATE 34 | PHANTOM_REGISTER(Functions) { this_().function("SolveAliasTemplateDefaultArguments", SolveAliasTemplateDefaultArguments)({"a_pTS","a_Defaults"});} 35 | #endif // PHANTOM_NOT_TEMPLATE 36 | PHANTOM_END("AliasTemplate") 37 | PHANTOM_END("phantom.lang.registration") 38 | } 39 | } 40 | 41 | #if defined(_MSC_VER) 42 | # pragma warning(pop) 43 | #elif defined(__clang__) 44 | # pragma clang diagnostic pop 45 | #endif 46 | 47 | // clang-format on 48 | 49 | // haunt } 50 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/AliasTemplate.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "AliasTemplate.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/Annotation.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "registration.h" 10 | 11 | #define PHANTOM_ANNOTATION(DblQuoted) (this_())(DblQuoted) 12 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/Constant.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "Variable.h" 10 | 11 | #include 12 | 13 | #define PHANTOM_CONSTANT(Name) \ 14 | PHANTOM_REGISTER(Variables) \ 15 | { \ 16 | (this_()).constant(PHANTOM_PP_QUOTE(Name), Name); \ 17 | } \ 18 | _PHNTM_PRE_TRAILING_METADATA _PHNTM_TRAILING_METADATA_COUNTER_MINUS_1 19 | #define PHANTOM_MCONSTANT(Name) (this_()).constant(#Name, PHANTOM_SCOPE::Name) 20 | #define PHANTOM_T_MCONSTANT(Name) (this_()).PHANTOM_T constant(#Name, PHANTOM_SCOPE::Name) 21 | #define PHANTOM_STATIC_CONSTANT PHANTOM_MCONSTANT 22 | #define PHANTOM_T_STATIC_CONSTANT PHANTOM_T_MCONSTANT 23 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/Field.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "registration.h" 10 | 11 | #include 12 | 13 | namespace phantom 14 | { 15 | namespace lang 16 | { 17 | } 18 | } // namespace phantom 19 | 20 | #define PHANTOM_FIELD(...) PHANTOM_PP_VARARG(_PHNTM_FIELD_, ##__VA_ARGS__) _PHNTM_MTRAILING_METADATA 21 | #define PHANTOM_T_FIELD(...) \ 22 | PHANTOM_PP_VARARG(_PHNTM_T_FIELD_, ##__VA_ARGS__) _PHNTM_MTRAILING_METADATA 23 | 24 | #define _PHNTM_FIELD_1(name) (this_()).field(PHANTOM_PP_QUOTE(name), &PHANTOM_SCOPE::name); 25 | #define _PHNTM_FIELD_2(name, modifiers) \ 26 | (this_()).field(PHANTOM_PP_QUOTE(name), &PHANTOM_SCOPE::name); 27 | 28 | #define _PHNTM_T_FIELD_1(name) \ 29 | (this_()).PHANTOM_T field(PHANTOM_PP_QUOTE(name), &PHANTOM_SCOPE::name); 30 | #define _PHNTM_T_FIELD_2(name, modifiers) \ 31 | (this_()).PHANTOM_T field(PHANTOM_PP_QUOTE(name), &PHANTOM_SCOPE::name); 32 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/Friend.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | HAUNT_STOP; 12 | 13 | #include "ClassType.h" 14 | #include "registration.h" 15 | 16 | #define PHANTOM_FRIEND(name) .friend_(PHANTOM_PP_QUOTE(name)) 17 | #define PHANTOM_FRIEND_CLASS(name) .friend_() 18 | #define PHANTOM_T_FRIEND(name) PHANTOM_T PHANTOM_FRIEND(name) 19 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/Main.hxx.cpp: -------------------------------------------------------------------------------- 1 | #include "Main.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/Privates.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // This macro, declared inside any namespace, allows to use 'PHANTOM_PRIVATE_ACCESS' inside any class of this namespace. 4 | // A good practice is to put this macro in your top forwarding header (ex: forward.h or prerequisistes.h) so that you 5 | // don't have to worry about it later (you can also use directly macro content to avoid any phantom direct includes) 6 | 7 | #define PHANTOM_FORWARD_DECL_NAMESPACE \ 8 | template \ 9 | struct _PHNTM_Registrer 10 | 11 | // This allows phantom to access private members of your class/struct/union and register them to reflection 12 | // Indeed by default, Phantom cannot access any private member, which is normal considering what a 'private' is. 13 | // (Phantom can access your protected members thanks to an inheritance hack though..) 14 | // If you get a compilation error 'undefined _PHNTM_Registrer' symbol here you should use the macro above 15 | // 'PHANTOM_FORWARD_DECL_NAMESPACE' inside the namespace where your class with privates is. 16 | 17 | #define PHANTOM_PRIVATE_ACCESS \ 18 | template \ 19 | friend struct _PHNTM_Registrer 20 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/Signal.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | HAUNT_STOP; 12 | 13 | #include "registration.h" 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #define PHANTOM_T_SIGNAL(name) PHANTOM_T PHANTOM_SIGNAL(name) 20 | #define PHANTOM_SIGNAL(name) .signal(PHANTOM_PP_QUOTE(name), &_::name) 21 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/Template.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | HAUNT_STOP; 12 | 13 | #include 14 | #include 15 | 16 | namespace phantom 17 | { 18 | namespace lang 19 | { 20 | struct PHANTOM_EXPORT_PHANTOM TemplateRegistrer : public ::phantom::detail::_PHNTM_StaticGlobalRegistrer 21 | { 22 | TemplateRegistrer(StringView (*func)(int), const char* a_strFile, int line, int tag); 23 | void _PHNTM_process(phantom::RegistrationStep PHANTOM_REGISTRATION_STEP) override; 24 | 25 | private: 26 | StringView (*m_func)(int); 27 | }; 28 | 29 | struct PHANTOM_EXPORT_PHANTOM TemplatePartialRegistrer : public ::phantom::detail::_PHNTM_StaticGlobalRegistrer 30 | { 31 | TemplatePartialRegistrer(StringView (*func)(int), const char* a_strFile, int line, int tag); 32 | void _PHNTM_process(phantom::RegistrationStep PHANTOM_REGISTRATION_STEP) override; 33 | 34 | private: 35 | StringView (*m_func)(int); 36 | }; 37 | 38 | } // namespace lang 39 | } // namespace phantom 40 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/TemplateInstance.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "GlobalRegistrer.h" 10 | #include "registration.h" 11 | 12 | #include 13 | 14 | #define PHANTOM_TEMPLATE_INSTANCE(...) \ 15 | namespace \ 16 | { \ 17 | static_assert( \ 18 | !std::is_same::value, \ 19 | "no template lang found for '" PHANTOM_PP_QUOTE( \ 20 | __VA_ARGS__) "' ; if using haunt, the associated '.hxx' #include is probably missing"); \ 21 | PHANTOM_REGISTER(End) { phantom::TypeOf(_PHNTM_TypeOfVal(__VA_ARGS__)); } \ 22 | } 23 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/lang/registration/Variable.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "Namespace.h" 10 | #include "registration.h" 11 | 12 | #include 13 | 14 | #define PHANTOM_VARIABLE(Name) \ 15 | PHANTOM_REGISTER(Variables, End) \ 16 | { \ 17 | if (PHANTOM_REGISTRATION_STEP == phantom::RegistrationStep::Typedefs) \ 18 | (this_()).variable(PHANTOM_PP_QUOTE(Name), Name); \ 19 | } \ 20 | _PHNTM_PRE_TRAILING_METADATA _PHNTM_TRAILING_METADATA_COUNTER_MINUS_1 21 | #define PHANTOM_STATIC_FIELD(Name) \ 22 | (this_()).staticField(PHANTOM_PP_QUOTE(Name), Name); \ 23 | _PHNTM_MTRAILING_METADATA 24 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/main: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/meta_type: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/method: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/namespace: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/namespace_alias: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/package: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/plugin: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/plugin.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /* ****************** Includes ******************* */ 10 | #include 11 | /* *********************************************** */ 12 | 13 | //========================================================== 14 | // Macro for export / import 15 | //========================================================== 16 | 17 | #if !defined(PHANTOM_STATIC_LINK_PHANTOM) 18 | # if defined(PHANTOM_LIB_PHANTOM) 19 | # define PHANTOM_EXPORT_PHANTOM PHANTOM_VISIBILITY_EXPORT 20 | # else 21 | # define PHANTOM_EXPORT_PHANTOM PHANTOM_VISIBILITY_IMPORT 22 | # endif 23 | 24 | #else // defined(PHANTOM_STATIC_LINK_PHANTOM) 25 | # define PHANTOM_EXPORT_PHANTOM 26 | 27 | #endif // !defined(PHANTOM_STATIC_LINK_PHANTOM) 28 | 29 | //========================================================== 30 | // Deactivation of warning 4251 31 | // "T1 needs a DLL interface to be used by T2 class clients" 32 | //========================================================== 33 | 34 | #ifdef _MSC_VER 35 | # pragma warning(disable : 4251) 36 | #endif 37 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/private: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/property: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/register: -------------------------------------------------------------------------------- 1 | #include "namespace" -------------------------------------------------------------------------------- /projects/Phantom/phantom/signal: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/source: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/stacked: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/static_constant: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include -------------------------------------------------------------------------------- /projects/Phantom/phantom/static_field: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/static_method: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/statics: -------------------------------------------------------------------------------- 1 | #include "namespace" 2 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/struct: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | #include 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/template: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | #include 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/template-only-pop: -------------------------------------------------------------------------------- 1 | #pragma pop_macro("PHANTOM_NOT_TEMPLATE") 2 | #pragma pop_macro("PHANTOM_IF_NOT_TEMPLATE_ONLY") 3 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/template-only-push: -------------------------------------------------------------------------------- 1 | #include // ensure macros are defined 2 | 3 | #pragma push_macro("PHANTOM_NOT_TEMPLATE") 4 | #pragma push_macro("PHANTOM_IF_NOT_TEMPLATE_ONLY") 5 | #undef PHANTOM_NOT_TEMPLATE 6 | #define PHANTOM_NOT_TEMPLATE 0 7 | #undef PHANTOM_IF_NOT_TEMPLATE_ONLY 8 | #define PHANTOM_IF_NOT_TEMPLATE_ONLY(...) 9 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/LockGuard.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | namespace phantom 10 | { 11 | template 12 | struct LockGuard 13 | { 14 | inline LockGuard(MutexT& _m) : m(&_m) 15 | { 16 | m->lock(); 17 | } 18 | inline ~LockGuard() 19 | { 20 | m->unlock(); 21 | } 22 | 23 | private: 24 | MutexT* m; 25 | }; 26 | } // namespace phantom 27 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/LockGuard.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // haunt { 4 | 5 | // clang-format off 6 | 7 | #include "LockGuard.h" 8 | 9 | #if defined(_MSC_VER) 10 | # pragma warning(push, 0) 11 | #elif defined(__clang__) 12 | # pragma clang diagnostic push 13 | # pragma clang diagnostic ignored "-Wall" 14 | # pragma clang diagnostic ignored "-Wextra" 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | namespace phantom { 24 | PHANTOM_PACKAGE("phantom.thread") 25 | PHANTOM_SOURCE("LockGuard") 26 | 27 | PHANTOM_STRUCT_T((class), (MutexT), LockGuard) 28 | { 29 | this_() 30 | .PHANTOM_T constructor()({"_m"}) 31 | ; 32 | } 33 | PHANTOM_END("LockGuard") 34 | PHANTOM_END("phantom.thread") 35 | } 36 | 37 | #if defined(_MSC_VER) 38 | # pragma warning(pop) 39 | #elif defined(__clang__) 40 | # pragma clang diagnostic pop 41 | #endif 42 | 43 | // clang-format on 44 | 45 | // haunt } 46 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/LockGuard.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "LockGuard.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/RecursiveMutex.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "LockGuard.h" 10 | #include "RecursiveSemaphore.h" 11 | 12 | namespace phantom 13 | { 14 | typedef RecursiveSemaphore RecursiveMutex; 15 | typedef LockGuard RecursiveMutexGuard; 16 | } // namespace phantom 17 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/RecursiveMutex.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // haunt { 4 | 5 | // clang-format off 6 | 7 | #include "RecursiveMutex.h" 8 | 9 | #if defined(_MSC_VER) 10 | # pragma warning(push, 0) 11 | #elif defined(__clang__) 12 | # pragma clang diagnostic push 13 | # pragma clang diagnostic ignored "-Wall" 14 | # pragma clang diagnostic ignored "-Wextra" 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | #include "LockGuard.hxx" 25 | #include "RecursiveSemaphore.hxx" 26 | 27 | #include 28 | 29 | namespace phantom { 30 | PHANTOM_PACKAGE("phantom.thread") 31 | PHANTOM_SOURCE("RecursiveMutex") 32 | 33 | #if PHANTOM_NOT_TEMPLATE 34 | PHANTOM_REGISTER(Typedefs) { this_().typedef_("RecursiveMutex"); } 35 | PHANTOM_REGISTER(Typedefs) { this_().typedef_("RecursiveMutexGuard"); } 36 | #endif // PHANTOM_NOT_TEMPLATE 37 | PHANTOM_END("RecursiveMutex") 38 | PHANTOM_END("phantom.thread") 39 | } 40 | 41 | #if defined(_MSC_VER) 42 | # pragma warning(pop) 43 | #elif defined(__clang__) 44 | # pragma clang diagnostic pop 45 | #endif 46 | 47 | // clang-format on 48 | 49 | // haunt } 50 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/RecursiveMutex.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "RecursiveMutex.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/RecursiveSemaphore.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "RecursiveSemaphore.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/RecursiveSpinMutex.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "RecursiveSemaphore.h" 10 | #include "Semaphore.h" 11 | 12 | namespace phantom 13 | { 14 | typedef RecursiveSemaphore RecursiveSpinMutex; 15 | } 16 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/RecursiveSpinMutex.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // haunt { 4 | 5 | // clang-format off 6 | 7 | #include "RecursiveSpinMutex.h" 8 | 9 | #if defined(_MSC_VER) 10 | # pragma warning(push, 0) 11 | #elif defined(__clang__) 12 | # pragma clang diagnostic push 13 | # pragma clang diagnostic ignored "-Wall" 14 | # pragma clang diagnostic ignored "-Wextra" 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | #include "RecursiveSemaphore.hxx" 25 | 26 | #include 27 | 28 | namespace phantom { 29 | PHANTOM_PACKAGE("phantom.thread") 30 | PHANTOM_SOURCE("RecursiveSpinMutex") 31 | 32 | #if PHANTOM_NOT_TEMPLATE 33 | PHANTOM_REGISTER(Typedefs) { this_().typedef_("RecursiveSpinMutex"); } 34 | #endif // PHANTOM_NOT_TEMPLATE 35 | PHANTOM_END("RecursiveSpinMutex") 36 | PHANTOM_END("phantom.thread") 37 | } 38 | 39 | #if defined(_MSC_VER) 40 | # pragma warning(pop) 41 | #elif defined(__clang__) 42 | # pragma clang diagnostic pop 43 | #endif 44 | 45 | // clang-format on 46 | 47 | // haunt } 48 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/RecursiveSpinMutex.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "RecursiveSpinMutex.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/Semaphore.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Semaphore.h" 8 | 9 | namespace phantom 10 | { 11 | Semaphore::Semaphore(uint initialValue /*= 0*/, int) : m_value(initialValue), m_waitingCount(0) 12 | { 13 | PHANTOM_ASSERT(initialValue >= 0); 14 | } 15 | 16 | void Semaphore::wait() 17 | { 18 | bool wakeUpAnother = false; 19 | { 20 | std::unique_lock lck(m_mutex); 21 | 22 | while (m_value == 0) 23 | { 24 | m_waitingCount++; 25 | m_cond.wait(lck); 26 | m_waitingCount--; 27 | } 28 | 29 | m_value--; 30 | 31 | if (m_value > 0 && m_waitingCount > 0) 32 | { 33 | wakeUpAnother = true; 34 | } 35 | } 36 | 37 | if (wakeUpAnother) 38 | { 39 | m_cond.notify_one(); 40 | } 41 | } 42 | 43 | void Semaphore::signal(int count /*= 1*/) 44 | { 45 | bool wakeUp = false; 46 | { 47 | m_mutex.lock(); 48 | 49 | m_value += count; 50 | 51 | if (m_waitingCount > 0) 52 | { 53 | wakeUp = true; 54 | } 55 | 56 | m_mutex.unlock(); 57 | } 58 | 59 | if (wakeUp) 60 | { 61 | m_cond.notify_one(); 62 | } 63 | } 64 | } // namespace phantom 65 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/Semaphore.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Semaphore.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/SpinMutex.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "LockGuard.h" 10 | 11 | #include 12 | 13 | namespace phantom 14 | { 15 | class SpinMutex 16 | { 17 | public: 18 | inline void lock() 19 | { 20 | while (lck.test_and_set(std::memory_order_acquire)) 21 | ; 22 | } 23 | 24 | inline void unlock() 25 | { 26 | lck.clear(std::memory_order_release); 27 | } 28 | 29 | LockGuard autoLock() 30 | { 31 | return LockGuard(*this); 32 | } 33 | 34 | private: 35 | std::atomic_flag lck = ATOMIC_FLAG_INIT; 36 | }; 37 | 38 | } // namespace phantom 39 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/SpinMutex.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // haunt { 4 | 5 | // clang-format off 6 | 7 | #include "SpinMutex.h" 8 | 9 | #if defined(_MSC_VER) 10 | # pragma warning(push, 0) 11 | #elif defined(__clang__) 12 | # pragma clang diagnostic push 13 | # pragma clang diagnostic ignored "-Wall" 14 | # pragma clang diagnostic ignored "-Wextra" 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | #include "LockGuard.hxx" 26 | 27 | #include 28 | 29 | namespace phantom { 30 | PHANTOM_PACKAGE("phantom.thread") 31 | PHANTOM_SOURCE("SpinMutex") 32 | 33 | #if PHANTOM_NOT_TEMPLATE 34 | PHANTOM_CLASS(SpinMutex) 35 | { 36 | this_()(PHANTOM_R_FLAG_NO_COPY) 37 | .public_() 38 | .method("lock", &_::lock) 39 | .method("unlock", &_::unlock) 40 | .method()>("autoLock", &_::autoLock) 41 | ; 42 | } 43 | #endif // PHANTOM_NOT_TEMPLATE 44 | PHANTOM_END("SpinMutex") 45 | PHANTOM_END("phantom.thread") 46 | } 47 | 48 | #if defined(_MSC_VER) 49 | # pragma warning(pop) 50 | #elif defined(__clang__) 51 | # pragma clang diagnostic pop 52 | #endif 53 | 54 | // clang-format on 55 | 56 | // haunt } 57 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/SpinMutex.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SpinMutex.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/thread/ThreadSafeArrayView.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "ThreadSafeArrayView.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/ContainerTraits.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | #include "CopyTraits.h" 9 | #include "ImplicitConv.h" 10 | 11 | namespace phantom 12 | { 13 | template().erase(std::declval()))> 15 | std::true_type HasContainerEraseH(Container&&); 16 | 17 | template 18 | std::false_type HasContainerEraseH(ImplicitConv); 19 | 20 | template 21 | struct HasContainerErase : decltype(HasContainerEraseH(std::declval())) 22 | { 23 | }; 24 | 25 | template().push_back(std::declval()))> 27 | std::true_type HasContainerPushBackH(Container&&); 28 | 29 | template 30 | std::false_type HasContainerPushBackH(ImplicitConv); 31 | 32 | template 33 | struct HasContainerPushBack : decltype(HasContainerPushBackH(std::declval())) 34 | { 35 | }; 36 | } // namespace phantom 37 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/Dereferencer.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | namespace phantom 10 | { 11 | template 12 | struct Dereferencer 13 | { 14 | inline static t_Ty apply(t_Ty value) 15 | { 16 | return value; 17 | } 18 | }; 19 | 20 | template 21 | struct Dereferencer 22 | { 23 | inline static t_Ty& apply(t_Ty* value) 24 | { 25 | return *value; 26 | } 27 | }; 28 | } // namespace phantom 29 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/EnumIntType.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /// @cond ADVANCED 10 | namespace phantom 11 | { 12 | namespace detail 13 | { 14 | template 15 | struct EnumIntTypeH; 16 | 17 | template 18 | struct EnumIntTypeH 19 | { 20 | typedef char type; 21 | }; 22 | template 23 | struct EnumIntTypeH 24 | { 25 | typedef short type; 26 | }; 27 | template 28 | struct EnumIntTypeH 29 | { 30 | typedef int type; 31 | }; 32 | template 33 | struct EnumIntTypeH 34 | { 35 | typedef long long type; 36 | }; 37 | } // namespace detail 38 | 39 | template 40 | struct EnumIntType : public detail::EnumIntTypeH 41 | { 42 | }; 43 | } // namespace phantom 44 | /// @endcond 45 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/FunctionTypeToFunctionPointerType.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | namespace phantom 10 | { 11 | template 12 | struct FunctionTypeToFunctionPointerType 13 | { 14 | using type = R (*)(); 15 | }; 16 | 17 | template 18 | struct FunctionTypeToFunctionPointerType 19 | { 20 | using type = R (*)(Params...); 21 | }; 22 | 23 | template 24 | struct FunctionTypeToFunctionPointerType 25 | { 26 | using type = R (*)(Params..., ...); 27 | }; 28 | 29 | #if PHANTOM_HAS_STDCALL 30 | template 31 | struct FunctionTypeToFunctionPointerType 32 | { 33 | using type = R(__stdcall*)(Params...); 34 | }; 35 | #endif 36 | 37 | #if PHANTOM_HAS_FASTCALL 38 | template 39 | struct FunctionTypeToFunctionPointerType 40 | { 41 | using type = R(__fastcall*)(Params...); 42 | }; 43 | #endif 44 | 45 | } // namespace phantom 46 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/HasEmbeddedRtti.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "HasField.h" 10 | 11 | #include 12 | 13 | PHANTOM_DEFINE_HAS_FIELD_NO_BASE_MACRO_PARAM(rtti); 14 | 15 | namespace phantom 16 | { 17 | /// @cond INTERNAL 18 | 19 | template 20 | struct HasEmbeddedRtti : public PHANTOM_PP_CAT(HasField_, rtti) 21 | { 22 | }; 23 | 24 | template 25 | struct HasEmbeddedProxyRtti : public PHANTOM_PP_CAT(HasField_, rtti) 26 | { 27 | }; 28 | 29 | template 30 | struct HasEmbeddedRttiNoBase : public PHANTOM_PP_CAT(HasFieldNoBase_, rtti) 31 | { 32 | }; 33 | 34 | template 35 | struct HasEmbeddedProxyRttiNoBase : public PHANTOM_PP_CAT(HasFieldNoBase_, rtti) 36 | { 37 | }; 38 | } // namespace phantom 39 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/HasEq.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "HasBinOp.h" 3 | 4 | HAUNT_STOP; 5 | 6 | namespace phantom 7 | { 8 | PHANTOM_MAKE_HAS_BIN_OP(HasEq, ==); 9 | } 10 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/HasGreater.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "HasBinOp.h" 3 | 4 | HAUNT_STOP; 5 | 6 | namespace phantom 7 | { 8 | PHANTOM_MAKE_HAS_BIN_OP(HasGreater, >); 9 | } 10 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/HasLess.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "HasBinOp.h" 3 | 4 | HAUNT_STOP; 5 | 6 | namespace phantom 7 | { 8 | PHANTOM_MAKE_HAS_BIN_OP(HasLess, <); 9 | } 10 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/HasVirtualDestructor.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /// @cond ADVANCED 12 | 13 | namespace phantom 14 | { 15 | template 16 | using HasVirtualDestructor = std::has_virtual_destructor; 17 | } 18 | 19 | /// @endcond 20 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/ImplicitConv.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | namespace phantom 10 | { 11 | template 12 | struct ImplicitConv 13 | { 14 | ImplicitConv(T&& d); 15 | }; 16 | } // namespace phantom 17 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/IntTypeBySize.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /// @cond ADVANCED 12 | namespace phantom 13 | { 14 | template 15 | struct IntTypeBySize; 16 | 17 | template<> 18 | struct IntTypeBySize<1> 19 | { 20 | typedef int8_t type; 21 | }; 22 | template<> 23 | struct IntTypeBySize<2> 24 | { 25 | typedef int16_t type; 26 | }; 27 | template<> 28 | struct IntTypeBySize<4> 29 | { 30 | typedef int32_t type; 31 | }; 32 | template<> 33 | struct IntTypeBySize<8> 34 | { 35 | typedef int64_t type; 36 | }; 37 | template<> 38 | struct IntTypeBySize<16> 39 | { 40 | struct type 41 | { 42 | int64_t hi; 43 | int64_t lo; 44 | }; 45 | }; 46 | } // namespace phantom 47 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/IsComplete.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /// @cond ADVANCED 10 | 11 | namespace phantom 12 | { 13 | #if defined(_MSC_VER) 14 | template 15 | struct IsComplete 16 | { 17 | static T& getT(); 18 | static char (&pass(T))[2]; 19 | static char pass(...); 20 | static const bool value = sizeof(pass(getT())) == 2; 21 | }; 22 | #else 23 | template 24 | struct IsComplete 25 | { 26 | typedef char false_type; 27 | typedef int true_type; 28 | template 29 | static typename std::enable_if::type test(int); 30 | template 31 | static false_type test(...); 32 | enum ENU 33 | { 34 | value = (sizeof(test(0)) == sizeof(true_type)) 35 | }; 36 | }; 37 | #endif 38 | } // namespace phantom 39 | 40 | /// @endcond 41 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/IsDataPointer.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /// @cond ADVANCED 12 | 13 | namespace phantom 14 | { 15 | template 16 | struct IsDataPointer : public std::false_type 17 | { 18 | }; 19 | 20 | template 21 | struct IsDataPointer : public std::true_type 22 | { 23 | }; 24 | 25 | template 26 | struct IsDataPointer : public std::true_type 27 | { 28 | }; 29 | 30 | template 31 | struct IsDataPointer : public std::true_type 32 | { 33 | }; 34 | 35 | template 36 | struct IsDataPointer : public std::true_type 37 | { 38 | }; 39 | } // namespace phantom 40 | 41 | /// @endcond 42 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/IsDefinedInContext.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /// @cond ADVANCED 12 | 13 | #if PHANTOM_COMPILER == PHANTOM_COMPILER_VISUAL_STUDIO && \ 14 | PHANTOM_COMPILER_VISUAL_STUDIO_VERSION <= PHANTOM_COMPILER_VISUAL_STUDIO_VERSION_2010 15 | namespace std 16 | { 17 | template 18 | typename add_rvalue_reference::type declval(); 19 | } 20 | #endif 21 | 22 | namespace phantom 23 | { 24 | template 25 | struct IsDefinedInContext 26 | { 27 | /* Has destructor */ 28 | template 29 | static std::true_type test(decltype(std::declval().~A())*); /* { 30 | return std::true_type(); 31 | }*/ 32 | 33 | /* Has no destructor */ 34 | template 35 | static std::false_type test(...); /* { 36 | return false_type(); 37 | }*/ 38 | 39 | /* This will be either `std::true_type` or `std::false_type` */ 40 | typedef decltype(test(0)) type; 41 | 42 | static const bool value = type::value; /* Which is it? */ 43 | }; 44 | } // namespace phantom 45 | 46 | /// @endcond 47 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/IsEnumClass.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | namespace phantom 10 | { 11 | namespace detail 12 | { 13 | template 14 | struct IsEnumClassH : std::false_type 15 | { 16 | }; 17 | 18 | template 19 | struct IsEnumClassH : std::true_type 20 | { 21 | }; 22 | } // namespace detail 23 | 24 | template 25 | using IsEnumClass = 26 | std::integral_constant::value && std::is_enum::value>; 27 | } // namespace phantom 28 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/IsFunctionPointer.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /// @cond ADVANCED 12 | 13 | namespace phantom 14 | { 15 | template 16 | struct IsFunctionPointer 17 | { 18 | static const bool value = std::is_pointer::value && !IsDataPointer::value; 19 | }; 20 | } // namespace phantom 21 | 22 | /// @endcond 23 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/IsNullptrT.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /// @cond ADVANCED 13 | 14 | namespace phantom 15 | { 16 | template 17 | struct IsNullptrT : public std::false_type 18 | { 19 | }; 20 | 21 | template<> 22 | struct IsNullptrT : public std::true_type 23 | { 24 | }; 25 | } // namespace phantom 26 | 27 | /// @endcond 28 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/IsStructure.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /// @cond ADVANCED 12 | 13 | namespace phantom 14 | { 15 | template 16 | struct IsStructure : public std::false_type 17 | { 18 | }; /// is specialized by PHANTOM_R_STRUCTURE 19 | } // namespace phantom 20 | 21 | /// @endcond 22 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/IsTemplate.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /// @cond ADVANCED 12 | 13 | namespace phantom 14 | { 15 | template 16 | struct IsTemplate : std::false_type 17 | { 18 | }; 19 | 20 | template class t_Ty, typename... t_Params> 21 | struct IsTemplate > : std::true_type 22 | { 23 | }; 24 | 25 | } // namespace phantom 26 | 27 | /// @endcond 28 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/IsTypeDefined.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace phantom 12 | { 13 | template 14 | struct IsTypeDefined : std::false_type 15 | { 16 | }; 17 | 18 | template 19 | struct IsTypeDefined 0)> > : std::true_type 20 | { 21 | }; 22 | } // namespace phantom 23 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/IsVoid.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | /// @cond ADVANCED 12 | 13 | namespace phantom 14 | { 15 | template 16 | struct IsVoid : public std::false_type 17 | { 18 | }; 19 | 20 | template<> 21 | struct IsVoid : public std::true_type 22 | { 23 | }; 24 | template<> 25 | struct IsVoid : public std::true_type 26 | { 27 | }; 28 | template<> 29 | struct IsVoid : public std::true_type 30 | { 31 | }; 32 | template<> 33 | struct IsVoid : public std::true_type 34 | { 35 | }; 36 | 37 | } // namespace phantom 38 | 39 | /// @endcond 40 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/ModifiersAndFlags.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | namespace phantom 14 | { 15 | /// @cond ADVANCED 16 | HAUNT_PAUSE; 17 | 18 | template 19 | struct ModifiersAndFlags : public std::integral_constant 20 | { 21 | }; 22 | 23 | template 24 | struct MetaModifiersAndFlags : public std::integral_constant 25 | { 26 | }; 27 | 28 | template 29 | struct MetaFlags : public std::integral_constant::value & 0xffffffff> 30 | { 31 | }; 32 | 33 | template 34 | struct MetaModifiers : public std::integral_constant::value >> 32) & 0xffffffff> 35 | { 36 | }; 37 | 38 | HAUNT_RESUME; 39 | /// @endcond 40 | } // namespace phantom 41 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/MoveArg.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | namespace phantom 10 | { 11 | struct MoveArg 12 | { 13 | explicit MoveArg(void* valueptr) : valueptr(valueptr){}; 14 | operator void*() const { return valueptr; } 15 | 16 | private: 17 | void* valueptr; 18 | }; 19 | } // namespace phantom 20 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/MovedValue.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | namespace phantom 10 | { 11 | struct MoveArg 12 | { 13 | explicit MoveArg(void* valueptr) : valueptr(valueptr){}; 14 | operator void*() const { return valueptr; } 15 | 16 | private: 17 | void* valueptr; 18 | }; 19 | } // namespace phantom 20 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/ReferenceToPointer.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /// @cond ADVANCED 10 | 11 | namespace phantom 12 | { 13 | template 14 | struct ReferenceToPointer 15 | { 16 | typedef t_Ty type; 17 | }; 18 | 19 | template 20 | struct ReferenceToPointer 21 | { 22 | typedef t_Ty* type; 23 | }; 24 | } // namespace phantom 25 | 26 | /// @endcond 27 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/RemoveAllPointers.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | namespace phantom 10 | { 11 | template 12 | struct remove_all_pointers 13 | { 14 | typedef T type; 15 | }; 16 | 17 | template 18 | struct remove_all_pointers 19 | { 20 | typedef typename remove_all_pointers::type type; 21 | }; 22 | 23 | template 24 | struct remove_all_pointers 25 | { 26 | typedef typename remove_all_pointers::type type; 27 | }; 28 | 29 | template 30 | struct remove_all_pointers 31 | { 32 | typedef typename remove_all_pointers::type type; 33 | }; 34 | 35 | template 36 | struct remove_all_pointers 37 | { 38 | typedef typename remove_all_pointers::type type; 39 | }; 40 | 41 | } // namespace phantom 42 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/RemoveConstReference.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | namespace phantom 10 | { 11 | template 12 | struct RemoveConstReference 13 | { 14 | typedef T type; 15 | }; 16 | template 17 | struct RemoveConstReference 18 | { 19 | typedef T type; 20 | }; 21 | } // namespace phantom 22 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/RemoveEveything.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "remove_all_pointers.h" 10 | 11 | #include 12 | 13 | namespace phantom 14 | { 15 | template 16 | struct remove_everything 17 | { 18 | typedef typename std::remove_all_extents::type>::type>::type>::type type; 20 | }; 21 | } // namespace phantom 22 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/SafeAlignOf.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | /// @cond ADVANCED 13 | 14 | namespace phantom 15 | { 16 | template 17 | struct SafeAlignOf : public std::alignment_of 18 | { 19 | }; 20 | 21 | template<> 22 | struct SafeAlignOf : std::integral_constant 23 | { 24 | }; 25 | } // namespace phantom 26 | 27 | /// @endcond 28 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/SafeSizeOf.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | /// @cond ADVANCED 15 | 16 | namespace phantom 17 | { 18 | template 19 | struct SafeSizeOf : std::integral_constant 20 | { 21 | }; 22 | 23 | template<> 24 | struct SafeSizeOf : std::integral_constant 25 | { 26 | }; 27 | 28 | } // namespace phantom 29 | 30 | /// @endcond 31 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/SelectType.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | namespace phantom 10 | { 11 | template 12 | struct SelectType 13 | { 14 | typedef T1 type; 15 | }; 16 | 17 | template 18 | struct SelectType 19 | { 20 | typedef T2 type; 21 | }; 22 | 23 | template 24 | using SelectTypeT = PHANTOM_TYPENAME SelectType::type; 25 | } // namespace phantom 26 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/TypeIdentity.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace phantom 4 | { 5 | template 6 | struct TypeIndentity 7 | { 8 | using type = T; 9 | }; 10 | 11 | template 12 | using TypeIndentityT = typename TypeIndentity::type; 13 | 14 | } // namespace phantom 15 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/traits/indices.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | /// @cond ADVANCED 10 | 11 | namespace phantom 12 | { 13 | template 14 | struct Indices 15 | { 16 | }; 17 | 18 | template 19 | struct BuildIndices : BuildIndices 20 | { 21 | }; 22 | 23 | template 24 | struct BuildIndices<0, Is...> : Indices 25 | { 26 | }; 27 | 28 | } // namespace phantom 29 | 30 | /// @endcond 31 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/typedef: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/typeof: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/union: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | #include 7 | #include 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/unionof: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/using: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "alias" 4 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/ArrayView.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "ArrayView.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/CallStackTrace.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace phantom 6 | { 7 | struct PHANTOM_EXPORT_PHANTOM CallStackTrace 8 | { 9 | // retrieve current call stack 10 | static size_t Capture(void** backTrace, size_t backTraceSize); 11 | 12 | // convert callstack into readable String 13 | static void ToString(const void* const* backTrace, size_t backTraceSize, char* buffer, size_t bufferSize); 14 | 15 | // return symbol line 16 | static int GetSymbolLine(const void* _ptr); 17 | 18 | // return readable symbol name 19 | static size_t GetSymbolName(const void* pt, char* buffer, size_t buffersize); 20 | }; 21 | } // namespace phantom 22 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/CallStackTrace.hxx.cpp: -------------------------------------------------------------------------------- 1 | #pragma warning(push, 0) 2 | #include "CallStackTrace.hxx" 3 | #pragma warning(pop) 4 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Delegate.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Delegate.h" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Delegate.hxx.cpp: -------------------------------------------------------------------------------- 1 | #include "Delegate.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/DynDelegate.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "DynDelegate.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Factory.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Flags.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | /* ******************* Includes ****************** */ 8 | #include "Flags.h" 9 | /* *********************************************** */ 10 | namespace phantom 11 | { 12 | } // namespace phantom 13 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Flags.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Flags.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/ForwardHeap.hxx.cpp: -------------------------------------------------------------------------------- 1 | #include "ForwardHeap.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Functor.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Functor.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/FunctorID.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | namespace phantom 10 | { 11 | struct FunctorID 12 | { 13 | FunctorID() = default; 14 | FunctorID(size_t a_Lo, size_t a_Hi) : lo(a_Lo), hi(a_Hi) {} 15 | FunctorID(void* a_Lo, void* a_Hi) : lo(size_t(a_Lo)), hi(size_t(a_Hi)) {} 16 | 17 | bool operator==(FunctorID const& a_Other) const { return lo == a_Other.lo && hi == a_Other.hi; } 18 | bool operator!=(FunctorID const& a_Other) const { return lo != a_Other.lo || hi != a_Other.hi; } 19 | 20 | bool operator<(FunctorID a_Other) const 21 | { 22 | if (hi == a_Other.hi) 23 | { 24 | return lo < a_Other.lo; 25 | } 26 | return hi < a_Other.hi; 27 | } 28 | 29 | bool isNull() const { return lo == 0 && hi == 0; } 30 | 31 | operator bool() const { return !isNull(); } 32 | 33 | private: 34 | size_t lo = 0; 35 | size_t hi = 0; 36 | }; 37 | } // namespace phantom 38 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/FunctorID.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "FunctorID.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Generic.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Generic.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/History.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "SmallVector.h" 5 | #include "String.h" 6 | #include "StringView.h" 7 | 8 | namespace phantom 9 | { 10 | struct PHANTOM_EXPORT_PHANTOM History 11 | { 12 | static const size_t callStackSize = 15; 13 | struct Entry 14 | { 15 | Entry() = default; 16 | Entry(const char* _text); 17 | 18 | String text; 19 | void* callStack[callStackSize]; 20 | }; 21 | 22 | void record(StringView _view); 23 | void record(); 24 | void record(const char* _Format, ...); 25 | void pop() { entries.pop_back(); } 26 | void dump(); 27 | 28 | SmallVector entries; 29 | }; 30 | } 31 | 32 | #if PHANTOM_DEBUG_LEVEL 33 | #define PHANTOM_HISTORY_RECORD(...) this->HISTORY.record(__VA_ARGS__) 34 | #define PHANTOM_CORE_HISTORY_RECORD_EXT(_this, ...) _this->HISTORY.record(__VA_ARGS__) 35 | #define PHANTOM_CORE_HISTORY_TRACE_CODE(...) do { PHANTOM_CORE_HISTORY_RECORD("code(%s|%d) %s", __FILE__, __LINE__, #__VA_ARGS__); __VA_ARGS__; } while(false) 36 | #define PHANTOM_CORE_HISTORY_DECL(...) HAUNT_OFF Wolf::History HISTORY 37 | #else 38 | #define PHANTOM_CORE_HISTORY_RECORD(...) 39 | #define PHANTOM_CORE_HISTORY_RECORD_EXT(_this, ...) 40 | #define PHANTOM_CORE_HISTORY_TRACE_CODE(...) do {__VA_ARGS__} while(false) 41 | #define PHANTOM_CORE_HISTORY_DECL(...) 42 | #endif 43 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/History.hxx.cpp: -------------------------------------------------------------------------------- 1 | #pragma warning(push, 0) 2 | #include "History.hxx" 3 | #pragma warning(pop) 4 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/LexicalCast.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlmillet/Phantom/e5579ea52dafded64fd2fe88aabfdf8a73534918/projects/Phantom/phantom/utils/LexicalCast.h -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Object.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Object.h" 8 | 9 | #include 10 | 11 | namespace phantom 12 | { 13 | void* Object::as(lang::Class* a_pClass) 14 | { 15 | return rtti.metaClass->upcast(a_pClass, rtti.instance); 16 | } 17 | void const* Object::as(lang::Class* a_pClass) const 18 | { 19 | return const_cast(this)->as(a_pClass); 20 | } 21 | } // namespace phantom 22 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Object.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Object.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Optional.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Optional.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/OptionalArrayView.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "ArrayView.h" 10 | #include "Optional.h" 11 | 12 | namespace phantom 13 | { 14 | template 15 | using OptionalArrayView = Optional>; 16 | 17 | template 18 | auto MakeOptionalArrayView(Container const* c) 19 | { 20 | return c ? OptionalArrayView(MakeArrayView(*c)) : NullOpt; 21 | } 22 | } // namespace phantom 23 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/OptionalArrayView.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // haunt { 4 | 5 | // clang-format off 6 | 7 | #include "OptionalArrayView.h" 8 | 9 | #if defined(_MSC_VER) 10 | # pragma warning(push, 0) 11 | #elif defined(__clang__) 12 | # pragma clang diagnostic push 13 | # pragma clang diagnostic ignored "-Wall" 14 | # pragma clang diagnostic ignored "-Wextra" 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | #include "ArrayView.hxx" 25 | #include "Optional.hxx" 26 | 27 | #include 28 | 29 | namespace phantom { 30 | PHANTOM_PACKAGE("phantom.utils") 31 | PHANTOM_SOURCE("OptionalArrayView") 32 | 33 | #if PHANTOM_NOT_TEMPLATE 34 | PHANTOM_ALIAS_TEMPLATE((class), (T), OptionalArrayView, Optional >); 35 | #endif // PHANTOM_NOT_TEMPLATE 36 | PHANTOM_END("OptionalArrayView") 37 | PHANTOM_END("phantom.utils") 38 | } 39 | 40 | #if defined(_MSC_VER) 41 | # pragma warning(pop) 42 | #elif defined(__clang__) 43 | # pragma clang diagnostic pop 44 | #endif 45 | 46 | // clang-format on 47 | 48 | // haunt } 49 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/OptionalArrayView.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "OptionalArrayView.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Pair.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Pair.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Path.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Path.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Placement.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Placement.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Property.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #define PHANTOM_FIELD_PROPERTY_DEF(type, Name, field) \ 12 | PHANTOM_PROPERTY_DEF(type, Name, (field = value;), (return field;)) 13 | 14 | #define PHANTOM_PROPERTY_DEF(type, Name, set_code, get_code) \ 15 | void set##Name(type value){PHANTOM_PP_IDENTITY set_code} type get##Name() \ 16 | const {PHANTOM_PP_IDENTITY get_code} HAUNT_ON HAUNT_PROPERTY(type, Name) 17 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/RTTI.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | #include 9 | 10 | HAUNT_STOP; 11 | 12 | #include 13 | 14 | namespace phantom 15 | { 16 | namespace lang 17 | { 18 | class Class; 19 | } 20 | struct PHANTOM_EXPORT_PHANTOM RTTI 21 | { 22 | HAUNT_OFF 23 | RTTI() = default; 24 | RTTI(RTTI const&) {} 25 | RTTI& operator=(RTTI const&) { return *this; } 26 | RTTI(RTTI&&) noexcept {} 27 | RTTI& operator=(RTTI&&) noexcept { return *this; } 28 | 29 | void* instance = nullptr; 30 | lang::Class* metaClass = nullptr; 31 | }; 32 | 33 | } // namespace phantom 34 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/ScopeExit.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | HAUNT_STOP; 12 | 13 | /* ****************** Includes ******************* */ 14 | #include 15 | /* *********************************************** */ 16 | 17 | namespace phantom 18 | { 19 | template 20 | struct ScopeExit 21 | { 22 | using SelfType = ScopeExit; 23 | ScopeExit(t_Functor a_F) : m_F(a_F) 24 | { 25 | } 26 | ~ScopeExit() 27 | { 28 | if (!m_bCancelled) 29 | m_F(); 30 | } 31 | ScopeExit(SelfType const&) = delete; 32 | ScopeExit(SelfType&& a_Temp) : m_F(std::move(a_Temp.m_F)) 33 | { 34 | a_Temp.m_bCancelled = true; 35 | } 36 | SelfType& operator=(SelfType const&) = delete; 37 | SelfType& operator=(SelfType&&) = delete; 38 | 39 | void cancel() 40 | { 41 | m_bCancelled = true; 42 | } 43 | 44 | private: 45 | t_Functor m_F; 46 | bool m_bCancelled = false; 47 | }; 48 | 49 | template 50 | PHANTOM_FORCEINLINE ScopeExit makeScopeExit(t_Functor&& a_F) 51 | { 52 | return ScopeExit(std::forward(a_F)); 53 | } 54 | } // namespace phantom 55 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Signal.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Signal.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/SmallMap.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SmallMap.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/SmallMultimap.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SmallMultimap.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/SmallSet.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SmallSet.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/SmallString.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SmallString.hxx" 8 | 9 | #if defined(_PHANTOM_MEASURE_AVERAGE_STRING_SIZE) 10 | namespace phantom 11 | { 12 | PHANTOM_EXPORT_PHANTOM size_t SmallStringTotalSize = 0; 13 | PHANTOM_EXPORT_PHANTOM size_t SmallStringTotalCount = 0; 14 | } // namespace phantom 15 | #endif 16 | 17 | #if defined(_MSC_VER) 18 | # pragma warning(push, 0) 19 | #elif defined(__clang__) 20 | # pragma clang diagnostic push 21 | # pragma clang diagnostic ignored "-Wall" 22 | # pragma clang diagnostic ignored "-Wextra" 23 | #endif 24 | 25 | PHANTOM_REGISTER(ClassTypes) 26 | { 27 | ::phantom::lang::BuiltInTypes::TYPE_STRING = (::phantom::lang::Class*)PHANTOM_TYPEOF(phantom::String); 28 | } 29 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/SmallVector.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SmallVector.h" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/SmallVector.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SmallVector.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/SmallVectorBasedContainer.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "SmallVectorBasedContainer.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/StaticIf.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | HAUNT_STOP; 12 | 13 | #include 14 | 15 | template 16 | T _PHNTM_IDTTY(T&& x) 17 | { 18 | return std::forward(x); 19 | } 20 | 21 | namespace phantom 22 | { 23 | namespace static_if_detail 24 | { 25 | struct identity 26 | { 27 | template 28 | auto&& operator()(T&& x) const 29 | { 30 | return std::forward(x); 31 | } 32 | }; 33 | 34 | template 35 | struct statement 36 | { 37 | template 38 | void then(const F& f) 39 | { 40 | f(identity()); 41 | } 42 | 43 | template 44 | void else_(const F&) 45 | { 46 | } 47 | }; 48 | 49 | template<> 50 | struct statement 51 | { 52 | template 53 | void then(const F&) 54 | { 55 | } 56 | 57 | template 58 | void else_(const F& f) 59 | { 60 | f(identity()); 61 | } 62 | }; 63 | 64 | } // end of namespace static_if_detail 65 | 66 | template 67 | static_if_detail::statement static_if(F const& f) 68 | { 69 | static_if_detail::statement if_; 70 | if_.then(f); 71 | return if_; 72 | } 73 | } // namespace phantom 74 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/String.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "SmallString.h" 10 | 11 | namespace phantom 12 | { 13 | PHANTOM_FORCEINLINE const char* cstr(const String& str) 14 | { 15 | return str.c_str(); 16 | } 17 | } // namespace phantom 18 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/String.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // haunt { 4 | 5 | // clang-format off 6 | 7 | #include "String.h" 8 | 9 | #if defined(_MSC_VER) 10 | # pragma warning(push, 0) 11 | #elif defined(__clang__) 12 | # pragma clang diagnostic push 13 | # pragma clang diagnostic ignored "-Wall" 14 | # pragma clang diagnostic ignored "-Wextra" 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | #include "SmallString.hxx" 25 | 26 | #include 27 | 28 | namespace phantom { 29 | PHANTOM_PACKAGE("phantom.utils") 30 | PHANTOM_SOURCE("String") 31 | 32 | #if PHANTOM_NOT_TEMPLATE 33 | PHANTOM_REGISTER(Functions) { this_().function("cstr", cstr)({"str"});} 34 | #endif // PHANTOM_NOT_TEMPLATE 35 | PHANTOM_END("String") 36 | PHANTOM_END("phantom.utils") 37 | } 38 | 39 | #if defined(_MSC_VER) 40 | # pragma warning(pop) 41 | #elif defined(__clang__) 42 | # pragma clang diagnostic pop 43 | #endif 44 | 45 | // clang-format on 46 | 47 | // haunt } 48 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/String.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "String.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/StringBuffer.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "SmallString.h" 10 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/StringHash.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "StringHash.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/StringUtil.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "StringUtil.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/StringView.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "StringView.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/StringViews.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include "SmallVector.h" 10 | #include "StringView.h" 11 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/StringWithHash.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "StringWithHash.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/Variant.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "Variant.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/VariantT.hxx.cpp: -------------------------------------------------------------------------------- 1 | #include "VariantT.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/crc64.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "crc64.h" 8 | 9 | namespace phantom 10 | { 11 | 12 | } // namespace phantom 13 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/crc64.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // haunt { 4 | 5 | // clang-format off 6 | 7 | #include "crc64.h" 8 | 9 | #if defined(_MSC_VER) 10 | # pragma warning(push, 0) 11 | #elif defined(__clang__) 12 | # pragma clang diagnostic push 13 | # pragma clang diagnostic ignored "-Wall" 14 | # pragma clang diagnostic ignored "-Wextra" 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | namespace phantom { 24 | PHANTOM_PACKAGE("phantom.utils") 25 | PHANTOM_SOURCE("crc64") 26 | 27 | #if PHANTOM_NOT_TEMPLATE 28 | PHANTOM_REGISTER(Variables) { this_().variable("crc64_tab", &crc64_tab); } 29 | PHANTOM_REGISTER(Functions) { this_().function("crc64", crc64)({"crc","s","l"});} 30 | #endif // PHANTOM_NOT_TEMPLATE 31 | PHANTOM_END("crc64") 32 | PHANTOM_END("phantom.utils") 33 | } 34 | 35 | #if defined(_MSC_VER) 36 | # pragma warning(pop) 37 | #elif defined(__clang__) 38 | # pragma clang diagnostic pop 39 | #endif 40 | 41 | // clang-format on 42 | 43 | // haunt } 44 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/crc64.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "crc64.hxx" -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/random.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | // This file is part of the Phantom library. Copyright 2015 Vivien Millet. 8 | // Distributed under the Lesser GNU Lesser General Public Licence, Version 3.0. (See 9 | // accompanying file LICENSE.txt or copy at 10 | // http://www.wiwila.com/open-source-tools/phantom/licence/) 11 | // ] 12 | 13 | #pragma once 14 | 15 | #include 16 | 17 | namespace phantom 18 | { 19 | namespace random 20 | { 21 | PHANTOM_EXPORT_PHANTOM void str(char* a_OutBuffer, StringView model = "%%%%%%%%-%%%%-%%%%-%%%%%%%%%%%%"); 22 | PHANTOM_EXPORT_PHANTOM uint64_t integer(); 23 | PHANTOM_EXPORT_PHANTOM double normalized(); 24 | } // namespace random 25 | } // namespace phantom 26 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/random.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // haunt { 4 | 5 | // clang-format off 6 | 7 | #include "random.h" 8 | 9 | #if defined(_MSC_VER) 10 | # pragma warning(push, 0) 11 | #elif defined(__clang__) 12 | # pragma clang diagnostic push 13 | # pragma clang diagnostic ignored "-Wall" 14 | # pragma clang diagnostic ignored "-Wextra" 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | #include "StringView.hxx" 25 | 26 | #include 27 | 28 | namespace phantom { 29 | namespace random { 30 | PHANTOM_PACKAGE("phantom.utils") 31 | PHANTOM_SOURCE("random") 32 | 33 | #if PHANTOM_NOT_TEMPLATE 34 | PHANTOM_REGISTER(Functions) { this_().function("str", str)({"a_OutBuffer","model"})["\"%%%%%%%%-%%%%-%%%%-%%%%%%%%%%%%\""];} 35 | PHANTOM_REGISTER(Functions) { this_().function("integer", integer);} 36 | PHANTOM_REGISTER(Functions) { this_().function("normalized", normalized);} 37 | #endif // PHANTOM_NOT_TEMPLATE 38 | PHANTOM_END("random") 39 | PHANTOM_END("phantom.utils") 40 | } 41 | } 42 | 43 | #if defined(_MSC_VER) 44 | # pragma warning(pop) 45 | #elif defined(__clang__) 46 | # pragma clang diagnostic pop 47 | #endif 48 | 49 | // clang-format on 50 | 51 | // haunt } 52 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/utils/random.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "random.hxx" 8 | -------------------------------------------------------------------------------- /projects/Phantom/phantom/variable: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2019 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at http://www.wiwila.com/tools/phantom/license/ 4 | // ] 5 | #pragma once 6 | 7 | #include 8 | -------------------------------------------------------------------------------- /projects/Phantom/std/initializer_list.h: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /projects/Phantom/std/initializer_list.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | PHANTOM_PACKAGE("std") 10 | PHANTOM_SOURCE("initializer_list") 11 | 12 | namespace std 13 | { 14 | /// initializer_list 15 | PHANTOM_CLASS_T((class), (t_Ty), initializer_list) 16 | { 17 | this_() 18 | .public_() 19 | .PHANTOM_T method("begin", &_::begin) 20 | .PHANTOM_T method("end", &_::end) 21 | .PHANTOM_T method("size", &_::size); 22 | } 23 | } // namespace std 24 | 25 | PHANTOM_END("initializer_list") 26 | PHANTOM_END("std") 27 | -------------------------------------------------------------------------------- /projects/Phantom/std/initializer_list.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "initializer_list.h" 8 | #include "initializer_list.hxx" 9 | -------------------------------------------------------------------------------- /projects/Phantom/std/numeric_limits.hxx: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // clang-format off 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #if defined(_MSC_VER) 12 | # pragma warning(push, 0) 13 | #elif defined(__clang__) 14 | # pragma clang diagnostic push 15 | # pragma clang diagnostic ignored "-Wall" 16 | # pragma clang diagnostic ignored "-Wextra" 17 | #endif 18 | 19 | #undef min 20 | #undef max 21 | 22 | PHANTOM_SOURCE("std.limits"); 23 | 24 | namespace std 25 | { 26 | PHANTOM_CLASS_T((class), (T), numeric_limits) 27 | { 28 | PHANTOM_PUBLIC: 29 | PHANTOM_STATIC_METHOD(T, min, ()); 30 | PHANTOM_STATIC_METHOD(T, max, ()); 31 | PHANTOM_STATIC_METHOD(T, lowest, ()); 32 | PHANTOM_STATIC_METHOD(T, epsilon, ()); 33 | PHANTOM_STATIC_METHOD(T, round_error, ()); 34 | PHANTOM_STATIC_METHOD(T, denorm_min, ()); 35 | PHANTOM_STATIC_METHOD(T, infinity, ()); 36 | PHANTOM_STATIC_METHOD(T, quiet_NaN, ()); 37 | PHANTOM_STATIC_METHOD(T, signaling_NaN, ()); 38 | } 39 | } // namespace std 40 | 41 | PHANTOM_END("std.limits"); 42 | 43 | #if defined(_MSC_VER) 44 | # pragma warning(pop) 45 | #elif defined(__clang__) 46 | # pragma clang diagnostic pop 47 | #endif 48 | -------------------------------------------------------------------------------- /projects/Phantom/std/numeric_limits.hxx.cpp: -------------------------------------------------------------------------------- 1 | // license [ 2 | // This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet. 3 | // Distributed under the MIT license. Text available here at 4 | // https://github.com/vlmillet/phantom 5 | // ] 6 | 7 | #include "numeric_limits.hxx" 8 | --------------------------------------------------------------------------------