【UE】UEC++委托代理

【UE】UEC++委托代理 

一、委托的声明与定义

#pragma once#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "DelegateGameMode.generated.h"//
// Declare DECLARE_DELEGATE
//
DECLARE_DELEGATE(FDeclareDelegate_00);
DECLARE_DELEGATE_OneParam(FDeclareDelegate_01, bool);
DECLARE_DELEGATE_TwoParams(FDeclareDelegate_02, bool, int32);
DECLARE_DELEGATE_RetVal(bool, FDeclareDelegate_03);
DECLARE_DELEGATE_RetVal_OneParam(bool, FDeclareDelegate_04, bool);//
// Declare DECLARE_MULTICAST_DELEGATE
//
DECLARE_MULTICAST_DELEGATE(FDeclareMulticastDelegate_00);
DECLARE_MULTICAST_DELEGATE_OneParam(FDeclareMulticastDelegate_01, int32);//
// Declare DECLARE_DYNAMIC_DELEGATE
//
DECLARE_DYNAMIC_DELEGATE(FDeclareDynamicDelegate_00);
DECLARE_DYNAMIC_DELEGATE_OneParam(FDeclareDynamicDelegate_01, int32, iValue);
DECLARE_DYNAMIC_DELEGATE_RetVal(bool, FDeclareDynamicDelegate_02);
DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam(bool, FDeclareDynamicDelegate_03, int32, iValue);//
// Declare DECLARE_DYNAMIC_MULTICAST_DELEGATE
//
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FDeclareDynamicMulticastDelegate_00);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDeclareDynamicMulticastDelegate_01, int32, iValue);UCLASS()
class DELEGATE_API ADelegateGameMode : public AGameModeBase
{GENERATED_BODY()
public://// Define DECLARE_DELEGATE//FDeclareDelegate_00 DeclareDelegate_00;FDeclareDelegate_01 DeclareDelegate_01;FDeclareDelegate_02 DeclareDelegate_02;FDeclareDelegate_03 DeclareDelegate_03;FDeclareDelegate_04 DeclareDelegate_04;//// Define DECLARE_MULTICAST_DELEGATE//FDeclareMulticastDelegate_00 DeclareMulticastDelegate_00;FDeclareMulticastDelegate_01 DeclareMulticastDelegate_01;//// Define DECLARE_DYNAMIC_DELEGATE//FDeclareDynamicDelegate_00 DeclareDynamicDelegate_00;FDeclareDynamicDelegate_01 DeclareDynamicDelegate_01;FDeclareDynamicDelegate_02 DeclareDynamicDelegate_02;FDeclareDynamicDelegate_03 DeclareDynamicDelegate_03;//// Define DECLARE_DYNAMIC_MULTICAST_DELEGATE//FDeclareDynamicMulticastDelegate_00 DeclareDynamicMulticastDelegate_00;FDeclareDynamicMulticastDelegate_01 DeclareDynamicMulticastDelegate_01;
};

二、单播绑定与解绑

#pragma once#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "DeclareDelegate.generated.h"UCLASS()
class DELEGATE_API ADeclareDelegate : public AActor
{GENERATED_BODY()
public:	ADeclareDelegate();virtual void Tick(float DeltaTime) override;
protected:virtual void BeginPlay() override;virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
public:UFUNCTION()void BindDelegate();UFUNCTION()void UnBindDelegate();UFUNCTION()void FunNoParam();UFUNCTION()void FunOneParam(bool bValue);UFUNCTION()void FunTwoParam(bool bValue, int32 iValue);UFUNCTION()bool FunRetValNoParam();UFUNCTION()bool FunRetValOneParam(bool bValue);
};
#include "DeclareDelegate.h"#include "Delegate/GameMode/DelegateGameMode.h"
#include "Kismet/GameplayStatics.h"ADeclareDelegate::ADeclareDelegate()
{PrimaryActorTick.bCanEverTick = false;
}void ADeclareDelegate::Tick(float DeltaTime)
{Super::Tick(DeltaTime);
}void ADeclareDelegate::BeginPlay()
{Super::BeginPlay();BindDelegate();
}void ADeclareDelegate::EndPlay(const EEndPlayReason::Type EndPlayReason)
{Super::EndPlay(EndPlayReason);UnBindDelegate();
}void ADeclareDelegate::BindDelegate()
{UE_LOG(LogTemp,Log,TEXT("DeclareDelegateActor::BindDegelate"))if(GetWorld()){ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));DelegateGameMode->DeclareDelegate_00.BindUObject(this, &ThisClass::FunNoParam);DelegateGameMode->DeclareDelegate_01.BindUFunction(this, "FunOneParam");DelegateGameMode->DeclareDelegate_02.BindUObject(this, &ThisClass::FunTwoParam);DelegateGameMode->DeclareDelegate_03.BindUObject(this, &ThisClass::FunRetValNoParam);DelegateGameMode->DeclareDelegate_04.BindUFunction(this, "FunRetValOneParam");}
}void ADeclareDelegate::UnBindDelegate()
{UE_LOG(LogTemp,Log,TEXT("DeclareDelegateActor::UnBindDegelate"))if(GetWorld()){ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));DelegateGameMode->DeclareDelegate_00.Unbind();DelegateGameMode->DeclareDelegate_01.Unbind();DelegateGameMode->DeclareDelegate_02.Unbind();DelegateGameMode->DeclareDelegate_03.Unbind();DelegateGameMode->DeclareDelegate_04.Unbind();}
}void ADeclareDelegate::FunNoParam()
{UE_LOG(LogTemp,Log,TEXT("DeclareDelegateActor::FunNoParam"))
}void ADeclareDelegate::FunOneParam(bool bValue)
{UE_LOG(LogTemp,Log,TEXT("DeclareDelegateActor::FunOneParam"))
}void ADeclareDelegate::FunTwoParam(bool bValue, int32 iValue)
{UE_LOG(LogTemp,Log,TEXT("DeclareDelegateActor::FunTwoParam"))
}bool ADeclareDelegate::FunRetValNoParam()
{UE_LOG(LogTemp,Log,TEXT("DeclareDelegateActor::FunRetValNoParam"))return false;
}bool ADeclareDelegate::FunRetValOneParam(bool bValue)
{UE_LOG(LogTemp,Log,TEXT("DeclareDelegateActor::FunRetValOneParam"))return bValue;
}

三、多播绑定与解绑

#pragma once#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "DeclareMulticastDelegate.generated.h"UCLASS()
class DELEGATE_API ADeclareMulticastDelegate : public AActor
{GENERATED_BODY()public:	ADeclareMulticastDelegate();virtual void Tick(float DeltaTime) override;
protected:virtual void BeginPlay() override;virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
public:UFUNCTION()void BindDelegate();UFUNCTION()void UnBindDelegate();UFUNCTION()void FunNoParam_One();UFUNCTION()void FunNoParam_Two();UFUNCTION()void FunOneParam_One(int32 iValue);UFUNCTION()void FunOneParam_Two(int32 iValue);
private:FDelegateHandle DelegateHandle;TArray<FDelegateHandle> DelegateHandles;
};
#include "DeclareMulticastDelegate.h"#include "Delegate/GameMode/DelegateGameMode.h"
#include "Kismet/GameplayStatics.h"ADeclareMulticastDelegate::ADeclareMulticastDelegate()
{PrimaryActorTick.bCanEverTick = false;
}void ADeclareMulticastDelegate::Tick(float DeltaTime)
{Super::Tick(DeltaTime);
}void ADeclareMulticastDelegate::BeginPlay()
{Super::BeginPlay();BindDelegate();
}void ADeclareMulticastDelegate::EndPlay(const EEndPlayReason::Type EndPlayReason)
{Super::EndPlay(EndPlayReason);UnBindDelegate();
}void ADeclareMulticastDelegate::BindDelegate()
{UE_LOG(LogTemp,Log,TEXT("DeclareMulticastDelegateActor::BindDegelate"))if(GetWorld()){ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));DelegateGameMode->DeclareMulticastDelegate_00.AddUObject(this, &ThisClass::FunNoParam_One);DelegateHandle = DelegateGameMode->DeclareMulticastDelegate_00.AddUFunction(this, "FunNoParam_Two");DelegateHandles.Add(DelegateGameMode->DeclareMulticastDelegate_01.AddUObject(this, &ThisClass::FunOneParam_One));DelegateHandles.Add(DelegateGameMode->DeclareMulticastDelegate_01.AddUFunction(this, "FunOneParam_Two"));}
}void ADeclareMulticastDelegate::UnBindDelegate()
{UE_LOG(LogTemp,Log,TEXT("DeclareMulticastDelegateActor::UnBindDelegate"))if(GetWorld()){ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));DelegateGameMode->DeclareMulticastDelegate_00.RemoveAll(this);for(FDelegateHandle Handle : DelegateHandles){DelegateGameMode->DeclareMulticastDelegate_01.Remove(Handle);}}
}void ADeclareMulticastDelegate::FunNoParam_One()
{UE_LOG(LogTemp,Log,TEXT("DeclareMulticastDelegateActor::FunNoParam_One"))
}void ADeclareMulticastDelegate::FunNoParam_Two()
{UE_LOG(LogTemp,Log,TEXT("DeclareMulticastDelegateActor::FunNoParam_Two"))if(GetWorld()){ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));DelegateGameMode->DeclareMulticastDelegate_00.Remove(DelegateHandle);}
}void ADeclareMulticastDelegate::FunOneParam_One(int32 iValue)
{UE_LOG(LogTemp,Log,TEXT("DeclareMulticastDelegateActor::FunOneParam_One"))
}void ADeclareMulticastDelegate::FunOneParam_Two(int32 iValue)
{UE_LOG(LogTemp,Log,TEXT("DeclareMulticastDelegateActor::FunOneParam_Two"))
}

四、动态单播绑定与解绑

#pragma once#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "DeclareDynamicDelegate.generated.h"UCLASS()
class DELEGATE_API ADeclareDynamicDelegate : public AActor
{GENERATED_BODY()
public:	ADeclareDynamicDelegate();virtual void Tick(float DeltaTime) override;
protected:virtual void BeginPlay() override;virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
public:	UFUNCTION()void BindDelegate();UFUNCTION()void UnBindDelegate();UFUNCTION()void FunNoParam();UFUNCTION()void FunOneParam(int32 iValue);UFUNCTION()bool FunRetValNoParam();UFUNCTION()bool FunRetValOneParam(int32 iValue);
};
#include "DeclareDynamicDelegate.h"#include "Delegate/GameMode/DelegateGameMode.h"
#include "Kismet/GameplayStatics.h"ADeclareDynamicDelegate::ADeclareDynamicDelegate()
{PrimaryActorTick.bCanEverTick = false;
}void ADeclareDynamicDelegate::Tick(float DeltaTime)
{Super::Tick(DeltaTime);
}void ADeclareDynamicDelegate::BeginPlay()
{Super::BeginPlay();BindDelegate();
}void ADeclareDynamicDelegate::EndPlay(const EEndPlayReason::Type EndPlayReason)
{Super::EndPlay(EndPlayReason);UnBindDelegate();
}void ADeclareDynamicDelegate::BindDelegate()
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicDelegate::BindDelegate"))if(GetWorld()){ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));DelegateGameMode->DeclareDynamicDelegate_00.BindDynamic(this, &ThisClass::FunNoParam);DelegateGameMode->DeclareDynamicDelegate_01.BindUFunction(this, "FunOneParam");DelegateGameMode->DeclareDynamicDelegate_02.BindDynamic(this, &ThisClass::FunRetValNoParam);DelegateGameMode->DeclareDynamicDelegate_03.BindUFunction(this, "FunRetValOneParam");}
}void ADeclareDynamicDelegate::UnBindDelegate()
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicDelegate::UnBindDelegate"))if(GetWorld()){ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));DelegateGameMode->DeclareDynamicDelegate_00.Clear();DelegateGameMode->DeclareDynamicDelegate_01.Unbind();DelegateGameMode->DeclareDynamicDelegate_02.Clear();DelegateGameMode->DeclareDynamicDelegate_03.Unbind();}
}void ADeclareDynamicDelegate::FunNoParam()
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicDelegate::FunNoParam"))
}void ADeclareDynamicDelegate::FunOneParam(int32 iValue)
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicDelegate::FunOneParam"))
}bool ADeclareDynamicDelegate::FunRetValNoParam()
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicDelegate::FunRetValNoParam"))return false;
}bool ADeclareDynamicDelegate::FunRetValOneParam(int32 iValue)
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicDelegate::FunRetValOneParam"))return false;
}

五、动态多播绑定与解绑

#pragma once#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "DeclareDynamicMulticastDelegate.generated.h"UCLASS()
class DELEGATE_API ADeclareDynamicMulticastDelegate : public AActor
{GENERATED_BODY()
public:	ADeclareDynamicMulticastDelegate();virtual void Tick(float DeltaTime) override;
protected:virtual void BeginPlay() override;virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
public:UFUNCTION()void BindDelegate();UFUNCTION()void UnBindDelegate();UFUNCTION()void FunNoParam_One();UFUNCTION()void FunNoParam_Two();UFUNCTION()void FunOneParam_One(int32 iValue);UFUNCTION()void FunOneParam_Two(int32 iValue);
};
#include "DeclareDynamicMulticastDelegate.h"#include "Delegate/GameMode/DelegateGameMode.h"
#include "Kismet/GameplayStatics.h"ADeclareDynamicMulticastDelegate::ADeclareDynamicMulticastDelegate()
{PrimaryActorTick.bCanEverTick = false;
}void ADeclareDynamicMulticastDelegate::Tick(float DeltaTime)
{Super::Tick(DeltaTime);
}void ADeclareDynamicMulticastDelegate::BeginPlay()
{Super::BeginPlay();BindDelegate();
}void ADeclareDynamicMulticastDelegate::EndPlay(const EEndPlayReason::Type EndPlayReason)
{Super::EndPlay(EndPlayReason);UnBindDelegate();
}void ADeclareDynamicMulticastDelegate::BindDelegate()
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicMulticastDelegate::BindDelegate"))if(GetWorld()){ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));DelegateGameMode->DeclareDynamicMulticastDelegate_00.AddDynamic(this, &ThisClass::FunNoParam_One);DelegateGameMode->DeclareDynamicMulticastDelegate_00.AddUniqueDynamic(this, &ThisClass::FunNoParam_Two);DelegateGameMode->DeclareDynamicMulticastDelegate_01.AddDynamic(this, &ThisClass::FunOneParam_One);DelegateGameMode->DeclareDynamicMulticastDelegate_01.AddUniqueDynamic(this, &ThisClass::FunOneParam_Two);}
}void ADeclareDynamicMulticastDelegate::UnBindDelegate()
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicMulticastDelegate::UnBindDelegate"))if(GetWorld()){ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));DelegateGameMode->DeclareDynamicMulticastDelegate_00.Remove(this, "FunNoParam_One");DelegateGameMode->DeclareDynamicMulticastDelegate_00.RemoveDynamic(this, &ThisClass::FunNoParam_Two);DelegateGameMode->DeclareDynamicMulticastDelegate_01.RemoveAll(this);}
}void ADeclareDynamicMulticastDelegate::FunNoParam_One()
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicMulticastDelegate::FunNoParam_One"))
}void ADeclareDynamicMulticastDelegate::FunNoParam_Two()
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicMulticastDelegate::FunNoParam_Two"))
}void ADeclareDynamicMulticastDelegate::FunOneParam_One(int32 iValue)
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicMulticastDelegate::FunOneParam_One"))
}void ADeclareDynamicMulticastDelegate::FunOneParam_Two(int32 iValue)
{UE_LOG(LogTemp,Log,TEXT("DeclareDynamicMulticastDelegate::FunOneParam_Two"))
}

六、委托的调用

#pragma once#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "DelegateController.generated.h"UCLASS()
class DELEGATE_API ADelegateController : public APlayerController
{GENERATED_BODY()
public:virtual void SetupInputComponent() override;////	Call Declare Delegate//UFUNCTION()void CallDeclareDelegate();////	Call Declare Multicast Delegate//UFUNCTION()void CallDeclareMulticastDelegate();////	Call Declare Dynamic Delegate//UFUNCTION()void CallDeclareDynamicDelegate();////	Call Declare Dynamic Multicast Delegate//UFUNCTION()void CallDeclareDynamicMulticastDelegate();
};
#include "DelegateController.h"#include "DelegateGameMode.h"
#include "Kismet/GameplayStatics.h"void ADelegateController::SetupInputComponent()
{Super::SetupInputComponent();InputComponent->BindAction("DeclareDelegate", IE_Pressed, this, &ThisClass::CallDeclareDelegate);InputComponent->BindAction("DeclareMulticastDelegate", IE_Pressed, this, &ThisClass::CallDeclareMulticastDelegate);InputComponent->BindAction("DeclareDynamicDelegate", IE_Pressed, this, &ThisClass::CallDeclareDynamicDelegate);InputComponent->BindAction("DeclareDynamicMulticastDelegate", IE_Pressed, this, &ThisClass::CallDeclareDynamicMulticastDelegate);
}void ADelegateController::CallDeclareDelegate()
{if(GetWorld() == nullptr) return;const ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));if(DelegateGameMode == nullptr) return;if(DelegateGameMode->DeclareDelegate_00.IsBound()){DelegateGameMode->DeclareDelegate_00.Execute();}DelegateGameMode->DeclareDelegate_01.ExecuteIfBound(true);DelegateGameMode->DeclareDelegate_02.ExecuteIfBound(true, 11);if(DelegateGameMode->DeclareDelegate_03.IsBound()){bool bValue = DelegateGameMode->DeclareDelegate_03.Execute();}if(DelegateGameMode->DeclareDelegate_04.IsBound()){bool bValue = DelegateGameMode->DeclareDelegate_04.Execute(true);}
}void ADelegateController::CallDeclareMulticastDelegate()
{if(GetWorld() == nullptr) return;const ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));if(DelegateGameMode == nullptr) return;if(DelegateGameMode->DeclareMulticastDelegate_00.IsBound()){DelegateGameMode->DeclareMulticastDelegate_00.Broadcast();}if(DelegateGameMode->DeclareMulticastDelegate_01.IsBound()){DelegateGameMode->DeclareMulticastDelegate_01.Broadcast(11);}
}void ADelegateController::CallDeclareDynamicDelegate()
{if(GetWorld() == nullptr) return;const ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));if(DelegateGameMode == nullptr) return;if(DelegateGameMode->DeclareDynamicDelegate_00.IsBound()){DelegateGameMode->DeclareDynamicDelegate_00.Execute();}DelegateGameMode->DeclareDynamicDelegate_01.ExecuteIfBound(11);if(DelegateGameMode->DeclareDynamicDelegate_02.IsBound()){bool bValue = DelegateGameMode->DeclareDynamicDelegate_02.Execute();}if(DelegateGameMode->DeclareDynamicDelegate_03.IsBound()){bool bValue = DelegateGameMode->DeclareDynamicDelegate_03.Execute(11);}
}void ADelegateController::CallDeclareDynamicMulticastDelegate()
{if(GetWorld() == nullptr) return;const ADelegateGameMode* DelegateGameMode = Cast<ADelegateGameMode>(UGameplayStatics::GetGameMode(GetWorld()));if(DelegateGameMode == nullptr) return;if(DelegateGameMode->DeclareDynamicMulticastDelegate_00.IsBound()){DelegateGameMode->DeclareDynamicMulticastDelegate_00.Broadcast();}if(DelegateGameMode->DeclareDynamicMulticastDelegate_01.IsBound()){DelegateGameMode->DeclareDynamicMulticastDelegate_01.Broadcast(11);}
}

七、运行结果

1、运行开始

2、调用单播

3、调用多播

再次调用

4、调用动态单播

5、调用动态多播

6、运行结束

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/185594.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【Linux】:信号(一)产生

信号 一.前台进程和后台进程1.前台进程2。后台进程3.总结 二.自定义信号动作接口三.信号的产生1.键盘组合键2.kill信号进程pid3.系统调用1.kill函数2.raise函数3.abort函数 四.异常五.软件条件六.core文件 一.前台进程和后台进程 1.前台进程 一个简单的代码演示 像这种程序在…

java中反射知识点概念

这里写自定义目录标题 1.什么是反射--动态注入&#xff1f;2.反射的诞生背景3.反射的意义4.反射后可以做些什么5.反射相关的主要API6.反射的优缺点7.反射和不反射基础使用8.工厂模式使用反射8.1首先我们来看看不使用反射的情况&#xff1a;8.2使用反射的情况&#xff1a; 9.Jav…

Cesium.CustomShader颜色值显示错误

官方示例&#xff1a; Cesium Sandcastle 测试过程&#xff1a; 1、修改示例&#xff0c;把customshader中的fragmentShaderText替换为如下代码 void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {//注意&#xff1a;下述颜色的b值是0.1&#x…

智能配电箱监控系统

智能配电箱监控系统是一种用于实时监控配电箱运行状态和电能质量的系统。它通过集成应用物联网技术&#xff0c;实现对配电箱的数据采集、整合和处理&#xff0c;从而让工作人员能够远程了解和掌握配电箱的情况。通过电力设备的数字化&#xff0c;依托电易云-智慧电力物联网&am…

数字孪生3D场景开发工具:弥补不足,开拓全新可能

随着数字化时代的来临&#xff0c;越来越多的企业和行业开始探索数字孪生技术的应用。数字孪生是指通过数字技术将现实世界中的物体、场景等复制到虚拟世界中&#xff0c;以实现实时监测、预测和优化。然而&#xff0c;在数字孪生的发展过程中&#xff0c;一些不足也逐渐浮现。…

如何去选择合适的线缆测试仪?CAT8网线认证测试

如何去选择合适的线缆测试仪? 如果你是第三方检测单位&#xff0c;系统集成商&#xff0c;或者线缆生产厂家&#xff0c;我个人建议选择福禄克DSX系列无疑是比较保险的做法&#xff0c;因为考虑到福禄克在国内耕耘多年所积累起来的品牌知名度和口碑&#xff0c;选择一款大家都…

PHP程序员必备技能:OSS云存储实现教程!

近些年来&#xff0c;云存储的应用越来越广泛&#xff0c;阿里云的OSS云存储服务也在国内市场中占据了一席之地。在此基础上&#xff0c;本文将分享如何使用PHP实现OSS云存储。 首先&#xff0c;我们需要在阿里云官网上注册一个账号并创建一个OSS存储空间。创建步骤在官方文档…

振南技术干货集:各大平台串口调试软件大赏(4)

注解目录 &#xff08;串口的重要性不言而喻。为什么很多平台把串口称为 tty&#xff0c;比如 Linux、MacOS 等等&#xff0c;振南告诉你。&#xff09; 1、各平台上的串口调试软件 1.1Windows 1.1.1 STCISP &#xff08;感谢 STC 姚老板设计出 STCISP 这个软件。&#xf…

相机标定张正友、opencv和halcon对比(1)

本文将从基本标定开始&#xff0c;结合实际工作经验&#xff0c;分析张正友、opencv和halcon三者相机标定的深层原理与不同之处&#xff0c;内容比较多&#xff0c;如果出现错误请指正。 相机光学模型 我们使用的镜头都是由多组镜片组成&#xff0c;它实际上是一种厚透镜模型…

羊大师提问,为什么吃得越咸越容易出现健康问题?

羊大师提问&#xff0c;为什么吃得越咸越容易出现健康问题&#xff1f; 在现代社会中&#xff0c;有一种追求咸味食物的趋势&#xff0c;许多人都钟爱于吃咸味食物。吃咸味食物往往容易导致健康问题&#xff0c;引发各种疾病。那么为什么吃的越咸越容易生病呢&#xff1f; 今…

C++二分查找算法:132 模式枚举3

说明 本篇是视频课程的讲义&#xff0c;可以看直接查看视频。也可以下载源码&#xff0c;包括空源码。 本文涉及的基础知识点 二分查找算法合集 本题不同解法 包括题目及代码C二分查找算法&#xff1a;132 模式解法一枚举3C二分查找算法&#xff1a;132 模式解法二枚举2代码…

黑洞:宇宙中最神秘的天体

黑洞&#xff1a;宇宙中最神秘的天体 一、引言 在浩瀚的宇宙中&#xff0c;有一种神秘的天体&#xff0c;它强大到连光也无法逃逸&#xff0c;这就是黑洞。自从黑洞理论被提出以来&#xff0c;它一直是物理学家和天文学家研究的焦点。尽管我们还无法直接看到黑洞&#xff0c;…

使用 Redis Zset 有序集合实现排行榜功能(SpringBoot环境)

目录 一、前言二、Redis Zset 的基本操作三、通过Redis 命令模拟排行榜功能3.1、排行榜生成3.2、排行榜查询 四、SpringBoot 使用 Redis Zset 有序集合实现排行榜功能 一、前言 排行榜功能是非常常见的需求&#xff0c;例如商品售卖排行榜单、游戏中的积分排行榜、配送员完单排…

VirtualBox上安装CentOS7

基础环境&#xff1a;宿主机是64位Windows10操作系统&#xff0c;通过无线网访问网络。 macOS可以以类似方式进行安装&#xff0c;不同之处见最后补充。 Step1 安装VirtualBox VirtualBox是一款免费、开源、高性能的虚拟机软件&#xff0c;可以跨平台运行&#xff0c;支持Wi…

【神印王座】永恒之塔秘密透露,林鑫告白李馨,皓晨采儿甜蜜接吻

Hello,小伙伴们&#xff0c;我是拾荒君。 《神印王座》第83集如期而至&#xff0c;带来了令人期待已久的更新。与众多热情的观众一样&#xff0c;拾荒君一得到更新消息&#xff0c;便急不可耐地观赏起来。这一集中&#xff0c;龙皓晨随着月魔宫的月夜商队成功抵达联盟&#xf…

C++: string的模拟实现

C: string的模拟实现 一.前置说明1.模拟实现string容器的目的2.我们要实现的大致框架 二.默认成员函数1.构造函数2.拷贝构造函数1.传统写法2.现代写法 3.析构函数4.赋值运算符重载1.传统写法2.现代写法 三.遍历和访问1.operator[]运算符重载2.iterator迭代器 四.容量相关函数1.…

ssm+vue的公司安全生产考试系统(有报告)。Javaee项目,ssm vue前后端分离项目。

演示视频&#xff1a; ssmvue的公司安全生产考试系统&#xff08;有报告&#xff09;。Javaee项目&#xff0c;ssm vue前后端分离项目。 项目介绍&#xff1a; 采用M&#xff08;model&#xff09;V&#xff08;view&#xff09;C&#xff08;controller&#xff09;三层体系结…

探索前端设计的新境界——介绍IVueUI工具助力Vue页面设计

在快速发展的前端领域&#xff0c;Vue.js作为一款渐进式JavaScript框架&#xff0c;一直备受开发者喜爱。然而&#xff0c;在Vue前端开发的旅程中&#xff0c;页面设计常常是一个不可避免的挑战。今天&#xff0c;我要向大家介绍一款令Vue前端开发者受益匪浅的工具——www.ivue…

Python文件操作

目录 一.文件的编码二.文件的读取三.文件的写入四.文件的追加五.文件操作综合案例 一.文件的编码 编码就是一种规则集合&#xff0c;记录了内容和二进制进行相互转换的逻辑。最常见的是UTF-8编码计算机只认识0和1&#xff0c;所以需要将内容翻译成0和1才能保存在计算机中。同时…

“大+小模型”赋能油气行业高质量发展

近日&#xff0c;中国石油石化科技创新大会暨新技术成果展在北京盛大举行&#xff0c;九章云极DataCanvas公司携油气行业一站式AI综合解决方案重磅亮相&#xff0c;充分展示了公司助推油气行业实现AI规模化应用深厚的AI技术实力和领先的AI应用水准&#xff0c;赢得了行业专家和…