blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 247 | content_id stringlengths 40 40 | detected_licenses listlengths 0 57 | license_type stringclasses 2 values | repo_name stringlengths 4 111 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 58 | visit_date timestamp[ns]date 2015-07-25 18:16:41 2023-09-06 10:45:08 | revision_date timestamp[ns]date 1970-01-14 14:03:36 2023-09-06 06:22:19 | committer_date timestamp[ns]date 1970-01-14 14:03:36 2023-09-06 06:22:19 | github_id int64 3.89k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 25 values | gha_event_created_at timestamp[ns]date 2012-06-07 00:51:45 2023-09-14 21:58:52 ⌀ | gha_created_at timestamp[ns]date 2008-03-27 23:40:48 2023-08-24 19:49:39 ⌀ | gha_language stringclasses 159 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 10.5M | extension stringclasses 111 values | filename stringlengths 1 195 | text stringlengths 7 10.5M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d5fdfdea652aea8cb89a85debdcca094669d9818 | 602e0f4bae605f59d23688cab5ad10c21fc5a34f | /MyToolKit/GB28181Client/Dll28181_Layer.cpp | 81306df63a55f50a765d236c24784425067cd898 | [] | no_license | yanbcxf/cpp | d7f26056d51f85254ae1dd2c4e8e459cfefb2fb6 | e059b02e7f1509918bbc346c555d42e8d06f4b8f | refs/heads/master | 2023-08-04T04:40:43.475657 | 2023-08-01T14:03:44 | 2023-08-01T14:03:44 | 172,408,660 | 8 | 5 | null | null | null | null | GB18030 | C++ | false | false | 10,715 | cpp | Dll28181_Layer.cpp |
#include "stdafx.h"
#include "dll28181_Layer.h"
#include "DllAlarmControl.h"
#include "DllCallBye.h"
#include "DllCallPlayPlaybackDownload.h"
#include "DllCallMediaControl.h"
#include "DllCataloginfoRequest.h"
#include "DllDeviceinfoRequest.h"
#include "DllPtzAutoScan.h"
#include "DllPtzMove.h"
#include "DllPtzPreset.h"
#include "DllPtzTour.h"
#include "DllRecordControl.h"
#include "DllSearchRecordfileRequest.h"
#include "DllStateinfoRequest.h"
#include "DllRegisterResponse.h"
#include "DllAlarmSubscribeRequest.h"
#include "SipdAlarmNotify.h"
#include "SipdCall200ok.h"
#include "SipdCallNoAnswer.h"
#include "SipdCataloginfoResponse.h"
#include "SipdDeviceinfoResponse.h"
#include "SipdMessage200ok.h"
#include "SipdMessageFailure.h"
#include "SipdRegisterRequest.h"
#include "SipdSearchRecordfileResponse.h"
#include "SipdStateinfoResponse.h"
#include "SipdCallFileToEnd.h"
#include "SipdKeepaliveRequest.h"
#include "SipdSubscribe200ok.h"
//UsageEnvironment g_UsageEnvironment;
Dll_Register_Request_func g_Dll_Register_Request_func;
Dll_Unregister_Request_func g_Dll_Unregister_Request_func;
Dll_ptz_response_func g_Dll_ptz_response_func;
Dll_cataloginfo_response_func g_Dll_cataloginfo_response_func;
Dll_deviceinfo_response_func g_Dll_deviceinfo_response_func;
Dll_stateinfo_response_func g_Dll_stateinfo_response_func;
Dll_search_recordfile_response_func g_Dll_search_recordfile_response_func;
Dll_Alarm_Request_func g_Dll_Alarm_Request_func;
Dll_Subscribe_response_func g_Dll_Subscribe_response_func;
Dll_Call_Response_func g_Dll_Call_Response_func;
void Register_Dll_Register_Request(Dll_Register_Request_func pfunc)
{
g_Dll_Register_Request_func = pfunc;
}
void Register_Dll_Unregister_Request(Dll_Unregister_Request_func pfunc)
{
g_Dll_Unregister_Request_func = pfunc;
}
int Dll_Register_Responce(int commandport, int isOk)
{
// 调用注册接口 ,允许或者禁止
CDllRegisterResponse * pObj = new CDllRegisterResponse(commandport, isOk);
return pObj->Call(UsageEnvironment::getInstance());
}
void Register_Dll_Alarm_Request(Dll_Alarm_Request_func pfunc)
{
g_Dll_Alarm_Request_func = pfunc;
}
int Dll_PTZ_Move(const sipd_ptz_control* pControl)
{
CDllPtzMove * pObj = new CDllPtzMove(pControl);
return pObj->Call(UsageEnvironment::getInstance());
}
int Dll_PTZ_Tour(const sipd_tour_control * pTourControl)
{
CDllPtzTour * pObj = new CDllPtzTour(pTourControl);
return pObj->Call(UsageEnvironment::getInstance());
}
int Dll_PTZ_Preset(const sipd_preset_control * pPresetControl)
{
CDllPtzPreset * pObj = new CDllPtzPreset(pPresetControl);
return pObj->Call(UsageEnvironment::getInstance());
}
int Dll_PTZ_AutoScan(const sipd_autoscan_control * pAutoScanControl)
{
CDllPtzAutoScan * pObj = new CDllPtzAutoScan(pAutoScanControl);
return pObj->Call(UsageEnvironment::getInstance());
}
int Dll_Reboot(const sipd_id_info * pIdInfo)
{
return 0;
}
int Dll_record_control(const sipd_record_control * pRecordControl)
{
CDllRecordControl * pObj = new CDllRecordControl(pRecordControl);
return pObj->Call(UsageEnvironment::getInstance());
}
int Dll_alarm_control (const sipd_alarm_control * pAlarmControl)
{
CDllAlarmControl * pObj = new CDllAlarmControl(pAlarmControl);
return pObj->Call(UsageEnvironment::getInstance());
}
int Register_Dll_ptz_response(Dll_ptz_response_func pfunc)
{
g_Dll_ptz_response_func = pfunc;
return 0;
}
/*报警事件订阅请求*/
int Dll_alarm_subscribe_request(const sipd_alarm_req * pStateInfoReq)
{
CDllAlarmSubscribeRequest * pObj = new CDllAlarmSubscribeRequest(pStateInfoReq);
return pObj->Call(UsageEnvironment::getInstance());
}
int Register_Dll_Subscribe_response(Dll_Subscribe_response_func pfunc)
{
g_Dll_Subscribe_response_func = pfunc;
return 0;
}
/*目录查询请求*/
int Dll_cataloginfo_request(const sipd_catalog_req * pCatalogReq)
{
CDllCataloginfoRequest * pObj = new CDllCataloginfoRequest(pCatalogReq);
return pObj->Call(UsageEnvironment::getInstance());
}
int Register_Dll_cataloginfo_response(Dll_cataloginfo_response_func pfunc)
{
g_Dll_cataloginfo_response_func = pfunc;
return 0;
}
/*信息查询请求*/
int Dll_deviceinfo_request(const sipd_deviceinfo_req * pDeviceinfoReq)
{
CDllDeviceinfoRequest * pObj = new CDllDeviceinfoRequest(pDeviceinfoReq);
return pObj->Call(UsageEnvironment::getInstance());
}
int Register_Dll_deviceinfo_response(Dll_deviceinfo_response_func pfunc)
{
g_Dll_deviceinfo_response_func = pfunc;
return 0;
}
/*状态查询请求*/
int Dll_stateinfo_request(const sipd_devicestate_req * pStateInfoReq)
{
CDllStateinfoRequest * pObj = new CDllStateinfoRequest(pStateInfoReq);
return pObj->Call(UsageEnvironment::getInstance());
}
int Register_Dll_stateinfo_response(Dll_stateinfo_response_func pfunc)
{
g_Dll_stateinfo_response_func = pfunc;
return 0;
}
/*录像文件查询请求*/
int Dll_search_recordfile_request (sipd_recordinfo_req * pRecordFileReq)
{
CDllSearchRecordfileRequest * pObj = new CDllSearchRecordfileRequest(pRecordFileReq);
return pObj->Call(UsageEnvironment::getInstance());
}
int Register_Dll_search_recordfile_response(Dll_search_recordfile_response_func pfunc)
{
g_Dll_search_recordfile_response_func = pfunc;
return 0;
}
//////////////////////////////////////////////////////////////////////////
int Sipd_Register_Request_Callback(sipd_register_req * pRegisterReq)
{
CSipdRegisterRequest * pObj = new CSipdRegisterRequest(pRegisterReq);
return pObj->Call(UsageEnvironment::getInstance());
}
int Sipd_Keepalive_Request_Callback(int tid, sipd_keepalive_notify * pKeepaliveReq)
{
CSipdKeepaliveRequest * pObj = new CSipdKeepaliveRequest(tid, pKeepaliveReq);
return pObj->Call(UsageEnvironment::getInstance());
}
int Sipd_Message_200ok_Callback(int tid)
{
CSipdMessage200ok * pObj = new CSipdMessage200ok(tid);
return pObj->Call(UsageEnvironment::getInstance());
return 0;
}
int Sipd_Message_Failure_Callback(int tid)
{
CSipdMessageFailure * pObj = new CSipdMessageFailure(tid);
return pObj->Call(UsageEnvironment::getInstance());
}
int Sipd_cataloginfo_response_Callback(sipd_catalog_rsp_basic_info* pCataBasicInfo, sipd_catalog_item* pCataItem, int tid)
{
CSipdCataloginfoResponse * pObj = new CSipdCataloginfoResponse(pCataBasicInfo, pCataItem, tid);
return pObj->Call(UsageEnvironment::getInstance());
}
int Sipd_deviceinfo_response_Callback(sipd_deviceinfo_rsp* pDeviceInfo, int tid)
{
CSipdDeviceinfoResponse * pObj = new CSipdDeviceinfoResponse(pDeviceInfo, tid);
return pObj->Call(UsageEnvironment::getInstance());
}
int Sipd_stateinfo_response_Callback(sipd_devicestate_rsp_basic_info* pStateBasicInfo, sipd_alarm_status_item* pStateItem, int tid)
{
CSipdStateinfoResponse * pObj = new CSipdStateinfoResponse(pStateBasicInfo, pStateItem, tid);
return pObj->Call(UsageEnvironment::getInstance());
}
int Sipd_search_recordfile_response_Callback(sipd_recordinfo_rsp_basic_info* pStateBasicInfo, sipd_file_item* pFileItem, int tid)
{
CSipdSearchRecordfileResponse * pObj = new CSipdSearchRecordfileResponse(pStateBasicInfo, pFileItem, tid);
return pObj->Call(UsageEnvironment::getInstance());
}
int Sipd_Alarm_Notify_Callback(sipd_alarm_notify * pAlarmNotify)
{
CSipdAlarmNotify * pObj = new CSipdAlarmNotify(pAlarmNotify);
return pObj->Call(UsageEnvironment::getInstance());
}
int Sipd_Subscribe_200_OK_Callback(sipd_subscribe_200_ok_info * pInfo,int sid)
{
CSipdSubscribe200ok * pObj = new CSipdSubscribe200ok(pInfo, sid);
return pObj->Call(UsageEnvironment::getInstance());
return 0;
}
//////////////////////////////////////////////////////////////////////////
int Register_Dll_Call_Response(Dll_Call_Response_func pfunc)
{
g_Dll_Call_Response_func = pfunc;
return 0;
}
int Sipd_Call_200_OK_Callback(int cid, int did, int tid, sipd_media_session* pSdp)
{
CSipdCall200ok * pObj = new CSipdCall200ok(cid, did, tid, pSdp);
return pObj->Call(UsageEnvironment::getInstance());
}
int Sipd_Call_File_to_end_Callback(int cid, int did, int tid, sipd_media_session* pSdp)
{
CSipdCallFileToEnd * pObj = new CSipdCallFileToEnd(cid);
return pObj->Call(UsageEnvironment::getInstance());
}
int Sipd_Call_No_Answer_Callback(int cid, int did, int tid, sipd_media_session* pSdp)
{
CSipdCallNoAnswer * pObj = new CSipdCallNoAnswer(cid);
return pObj->Call(UsageEnvironment::getInstance());
}
int Dll_Call_Bye(int playport)
{
CDllCallBye * pObj = new CDllCallBye(playport);
return pObj->Call(UsageEnvironment::getInstance());
}
int Dll_Call_play_playback_download( sipd_media_session* pMediaInfo)
{
CDllCallPlayPlaybackDownload * pObj = new CDllCallPlayPlaybackDownload(pMediaInfo);
return pObj->Call(UsageEnvironment::getInstance());
}
int Dll_Call_media_control(int playport, enum SIPD_TO_CMS_CMD_TYPE cmd_type,
sipd_playback_mans_rtsp_ind* playback_rtsp_control)
{
CDllCallMediaControl * pObj = new CDllCallMediaControl(playport, cmd_type, playback_rtsp_control);
return pObj->Call(UsageEnvironment::getInstance());
}
//////////////////////////////////////////////////////////////////////////
void DLL_Init(const SIPD_GATEWAY_CFG* pCfg)
{
g_Dll_Register_Request_func = NULL;
g_Dll_Unregister_Request_func = NULL;
g_Dll_ptz_response_func = NULL;
g_Dll_cataloginfo_response_func = NULL;
g_Dll_deviceinfo_response_func = NULL;
g_Dll_stateinfo_response_func = NULL;
g_Dll_search_recordfile_response_func = NULL;
g_Dll_Alarm_Request_func = NULL;
g_Dll_Call_Response_func = NULL;
g_Dll_Subscribe_response_func = NULL;
Register_Sipd_Register_Request(Sipd_Register_Request_Callback);
Register_Sipd_Keepalive_Notify(Sipd_Keepalive_Request_Callback);
Register_Sipd_Message_200_Ok(Sipd_Message_200ok_Callback);
Register_Sipd_Message_Failure(Sipd_Message_Failure_Callback);
Register_Sipd_cataloginfo_response(Sipd_cataloginfo_response_Callback);
Register_Sipd_deviceinfo_response(Sipd_deviceinfo_response_Callback);
Register_Sipd_stateinfo_response(Sipd_stateinfo_response_Callback);
Register_Sipd_search_recordfile_response(Sipd_search_recordfile_response_Callback);
Register_Sipd_Alarm_Notify(Sipd_Alarm_Notify_Callback);
Register_Sipd_subscribe_200_OK(Sipd_Subscribe_200_OK_Callback);
Register_Sipd_Call_200_OK(Sipd_Call_200_OK_Callback);
Register_Sipd_Call_File_to_end(Sipd_Call_File_to_end_Callback);
Register_Sipd_Call_No_Answer(Sipd_Call_No_Answer_Callback);
//Register_Media_Data_Callback();
// 初始化log4cplus
PropertyConfigurator::doConfigure(LOG4CPLUS_TEXT("log4cplus.properties"));
avcodec_register_all();
av_register_all();
// 启动处理线程
UsageEnvironment::getInstance().m_cfg = *pCfg;
Sleep(300);
// 启动 Sip 协议栈
sipd_init(pCfg);
}
void Dll_PS_Parser(string inputfile, string outputfile)
{
} |
119c104f3fb7e6f3bbf1a60a2a7215f790b939da | 30fb825789336b4be8129c94394afdf467a1500c | /samples/sample1_ellipse/main.cpp | 75dc0ec8fa6ecb05d40fa51540f0c39ec9a91eb4 | [
"MIT"
] | permissive | HolyChen/gcurval | 847c9e680b7372b1393e809403e49f6efad7a127 | bb8987ea9b499f5a991a93af17addb727834dfef | refs/heads/master | 2022-09-27T21:00:00.990262 | 2020-06-02T02:48:35 | 2020-06-02T02:48:35 | 268,083,342 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,689 | cpp | main.cpp | #include <iostream>
#include <random>
#include <fstream>
#include <queue>
#include <cuda_runtime.h>
#include <cuda_profiler_api.h>
#define USE_CUDA
#define USE_RMM
//#define ENABLE_NVVP
#define OUTPUT_RESULT
#include "ellipse.h"
using DataType = float;
#ifdef USE_CUDA
using ArclengthCalculate = ArclengthCalculateGpu<DataType>;
#else
using ArclengthCalculate = ArclengthCalculateCpu<DataType>;
#endif // USE_CUDA
void make_data_set(const int n_curve, const int seed, DataType* as, DataType* bs)
{
std::default_random_engine eg(seed);
std::uniform_real_distribution<DataType> dis(0.1, 2.0);
for (int i = 0; i < n_curve; i++)
{
auto a = DataType(1.0);
auto b = dis(eg) * a;
auto m = std::max(a, b);
as[i] = a / m;
bs[i] = b / m;
}
as[0] = DataType(1.0);
bs[0] = DataType(1.0);
}
void do_test(const int n_curve, const int n_seg, const int n_sub, const int n_ptrs_per_curve, const int seed = 413)
{
DataType *as = new DataType[n_curve], *bs = new DataType[n_curve];
make_data_set(n_curve, seed, as, bs);
ArclengthCalculate calculator(n_curve, as, bs);
{
gcurval::TimeCounter<> t;
calculator.createArclengthTable();
printf("%s\n", t.tell("ms", "Arc-Length Calculation:").c_str());
}
#ifdef OUTPUT_RESULT
{
auto arc = calculator.getAllCurveArclengths();
for (int i = 0; i < 10; i++)
{
printf("%d %f\n", i, arc[i]);
}
}
#endif // OUTPUT_RESULT
int *sample_ptrs = new int[n_curve];
DataType *position = new DataType[n_ptrs_per_curve * n_curve];
for (int i = 0; i < n_curve; i++)
{
sample_ptrs[i] = n_ptrs_per_curve;
for (int j = 0; j < n_ptrs_per_curve; j++)
{
position[i * n_ptrs_per_curve + j] = j * (1.0 / n_ptrs_per_curve);
}
}
RESULT_OF_T<decltype(&ArclengthCalculate::arclengthReverse)(
ArclengthCalculate,
int*, DataType*, bool, gcurval::GcurvalEnum, gcurval::GcurvalEnum)> result;
{
gcurval::TimeCounter<> t;
#ifdef OUTPUT_RESULT
result = calculator.arclengthReverse(sample_ptrs, position, true, gcurval::gcurvalHost,
gcurval::gcurvalReverseReturnPoints);
#else
result = calculator.arclengthReverse(sample_ptrs, position, true, gcurval::gcurvalDevice,
gcurval::gcurvalReverseReturnUs);
#endif // OUTPUT_RESULT
printf("%s\n", t.tell("ms", "Arc-Length Sampling:").c_str());
}
#ifdef OUTPUT_RESULT
for (int j = 0; j < 10; j++)
{
printf("\n\n\n============= %d =============\n", j);
printf("a,b: %f,%f", as[j], bs[j]);
printf("\n---------------------\n");
printf("[");
for (int i = 0; i < n_ptrs_per_curve; i++)
{
//printf("%f, ", result.us[j * n_ptrs_per_curve + i]);
printf("(%f, %f), ", result.points[j * n_ptrs_per_curve + i][0],
result.points[j * n_ptrs_per_curve + i][1]);
}
printf("]\n");
}
#endif // OUTPUT_RESULT
delete[] as;
delete[] bs;
}
int main(int argc, char* argv[])
{
#ifdef OUTPUT_RESULT
printf("Warning: Output result mode is enabled, the performance could be affected!");
#endif // OUTPUT_RESULT
printf("%s\n", sizeof(DataType) == sizeof(float) ? "float" : "double");
{
#ifdef USE_CUDA
// output cuda version
int cuda_runtime_version;
cudaRuntimeGetVersion(&cuda_runtime_version);
printf("CUDA Runtime: %d.%d\n", cuda_runtime_version / 1000, cuda_runtime_version % 1000);
// set stack size for recursive
cudaDeviceSetLimit(cudaLimitStackSize, 8192);
#ifdef ENABLE_NVVP
printf("Warning: NVVP is enabled\n");
cudaProfilerStart();
#endif // CUDA_PROFILE
#ifdef USE_RMM
printf("Rmm is used\n");
rmmOptions_t rmmOption;
rmmOption.allocation_mode = PoolAllocation;
rmmOption.initial_pool_size = 0x4000'0000; // 1 GB
rmmOption.enable_logging = false;
rmmInitialize(&rmmOption);
#endif // USE_RMM
#endif // USE_CUDA
}
// Set up the dataset
const int seed = 413; // The room number of our laboratory.
const int n_curve = argc > 1 ? std::stoi(argv[1]) : 1000;
const int n_seg = n_curve;
const int n_sub = n_seg * gcurval::N_SUBDIVIDED;
const int n_ptrs_per_curve = argc > 2 ? std::stoi(argv[2]) : 10000;
do_test(n_curve, n_seg, n_sub, n_ptrs_per_curve, seed);
{
#ifdef USE_CUDA
#ifdef USE_RMM
rmmFinalize();
#endif // USE_RMM
#ifdef ENABLE_NVVP
cudaProfilerStop();
#endif // ENABLE_NVVP
#endif // USE_CUDA
}
return 0;
} |
1264c9d86c2dfda672215dae7734b6e743eb3565 | 8e2e8d3adc6d72af5a91a45c04e0c7402056796b | /ifd.h | 4476e3e18b6c33e2246358567909b701c4c85b5f | [] | no_license | AliakseiPischyk/TIFF_Viewer | d9168da3d791f89353350ef6aea2a45b5696d2c6 | c3b0d7bbcd4b98737040af76eaa130781212eb2a | refs/heads/master | 2022-11-05T05:05:09.453452 | 2020-06-18T12:14:11 | 2020-06-18T12:14:11 | 270,983,212 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 197 | h | ifd.h | #ifndef IFD_H
#define IFD_H
#include "ihasoffset.h"
//image file directory
class IFD:public IHasOffset
{
public:
IFD(const unsigned int IFDOffset):IHasOffset(IFDOffset){};
};
#endif // IFD_H
|
3fdaf3934024710fbcf55c956cce220a10e0f441 | 3423592b2f917c3caf75fdbc24d21a210fbcef56 | /Enter_your_Home/Source/Enter_your_Home/GameControllers/EyH_FPSCharacter.h | 86bac21fe4acd116c31d4d36bc933685d431e286 | [
"Apache-2.0"
] | permissive | risooonho/Enter-your-House | 0d2a98214e357fe8777851912ac9debae5a5cc5f | 9c435adb372fca1e53d7d9dd29df6a68b6b42c3f | refs/heads/master | 2021-09-19T08:28:01.879493 | 2018-07-25T16:33:05 | 2018-07-25T16:33:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,681 | h | EyH_FPSCharacter.h | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Engine.h"
#include "GameFramework/Character.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "GameFramework/Actor.h"
#include "Camera/CameraComponent.h"
#include "Runtime/Core/Public/Math/Vector.h"
#include "Gameplay/StartCountdown.h"
#include "Gameplay/Grabber.h"
#include "Tests/MyActorComponent.h"
#include "ConstructorHelpers.h"
#include "EyH_FPSCharacter.generated.h"
UCLASS()
class ENTER_YOUR_HOME_API AEyH_FPSCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Constructor for AFPSCharacter
AEyH_FPSCharacter(const FObjectInitializer& ObjectInitializer);
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
// === Components ===
// First person camera
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera)
UCameraComponent* FPSCamera;
UPROPERTY(VisibleAnywhere)
UGrabber* Grabber;
UPROPERTY(VisibleAnywhere)
UMyActorComponent* MyActorComponent;
// === Input ===
/**handles moving forward/backward*/
UFUNCTION()
void MoveForward(float Val);
/**handles strafing*/
UFUNCTION()
void MoveRight(float Val);
/**sets jump flag when key is pressed*/
UFUNCTION()
void OnStartJump();
/**clears jump flag when key is released*/
UFUNCTION()
void OnStopJump();
};
|
1052e9faf4853d61afcc021498bc86276779fadd | 236d33902b9d4ea23ce6c064d7677ccc5c94a8b7 | /computer-graphics-meshes/src/per_corner_normals.cpp | 146c6e2962397e1ca41d5e51ed0b2b03f61f243b | [] | no_license | robertwyb/Computer-graphic-assignments | 30e460d8ac9242e1ceb22f9e1d9136f5a78c5277 | ec8411d187e23b4d8137ca91b967b691097e15d7 | refs/heads/master | 2020-05-18T13:52:49.397150 | 2019-05-01T18:06:34 | 2019-05-01T18:06:34 | 184,454,095 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,550 | cpp | per_corner_normals.cpp | #include "per_corner_normals.h"
#include "triangle_area_normal.h"
// Hint:
#include "vertex_triangle_adjacency.h"
#include <iostream>
void per_corner_normals(
const Eigen::MatrixXd & V,
const Eigen::MatrixXi & F,
const double corner_threshold,
Eigen::MatrixXd & N)
{
N = Eigen::MatrixXd::Zero(F.rows()*3,3);
double pi = 3.1415926;
std::vector<std::vector<int>> adj_lst;
vertex_triangle_adjacency(F, V.rows(), adj_lst);
for (int i=0; i < F.rows(); i++) {
Eigen::RowVector3d A = V.row(F(i, 0));
Eigen::RowVector3d B = V.row(F(i, 1));
Eigen::RowVector3d C = V.row(F(i, 2));
for (int j=0; j < F.cols(); j++) {
Eigen::RowVector3d NF = ((B-A).cross(C-A)).normalized();
double total_area = 0;
Eigen::RowVector3d vertex_normal (0, 0, 0);
for (const auto face : adj_lst[F(i, j)]) {
Eigen::RowVector3d A_ = V.row(F(face, 0));
Eigen::RowVector3d B_ = V.row(F(face, 1));
Eigen::RowVector3d C_ = V.row(F(face, 2));
Eigen::RowVector3d NF_ = ((B_-A_).cross(C_-A_)).normalized();
if (NF.dot(NF_) > cos(corner_threshold * pi / 180)) {
total_area += ((B_-A_).cross(C_-A_)).norm() * 0.5;
vertex_normal += triangle_area_normal(V.row(F(face, 0)), V.row(F(face, 1)), V.row(F(face, 2)));
}
}
N.row(i*3+j) = vertex_normal / total_area;
N.row(i*3+j) = N.row(i*3+j).normalized();
}
}
////////////////////////////////////////////////////////////////////////////
// Add your code here:
////////////////////////////////////////////////////////////////////////////
}
|
df009b0593387001aaf7d508e40f1edeb8871f4a | 436623ee85c9d9444d700b56f2729b12b9f2c659 | /src/modules/physics/include/eepp/physics/constraints/groovejoint.hpp | d5e5fea472e06ec1334ba90b0da22d9c0ccd8d9a | [
"MIT"
] | permissive | SpartanJ/eepp | 0bd271b33058ef119f5c34460ed94e44df882a25 | 9f64a2149f3a0842ced34b8b981ffe3a8efc6d13 | refs/heads/develop | 2023-09-01T01:17:30.155540 | 2023-08-27T20:58:19 | 2023-08-27T20:58:19 | 125,767,856 | 341 | 27 | MIT | 2023-04-01T20:10:26 | 2018-03-18T21:11:21 | C++ | UTF-8 | C++ | false | false | 727 | hpp | groovejoint.hpp | #ifndef EE_PHYSICS_CGROOVEJOINT_HPP
#define EE_PHYSICS_CGROOVEJOINT_HPP
#include <eepp/physics/constraints/constraint.hpp>
namespace EE { namespace Physics {
class EE_PHYSICS_API GrooveJoint : public Constraint {
public:
GrooveJoint( Body* a, Body* b, cVect groove_a, cVect groove_b, cVect anchr2 );
cVect getAnchr2();
void setAnchr2( const cVect& anchr2 );
cVect getGrooveA();
void setGrooveA( const cVect& groove_a );
cVect getGrooveB();
void setGrooveB( const cVect& groove_b );
virtual void draw();
#ifdef PHYSICS_RENDERER_ENABLED
cpFloat getDrawPointSize();
virtual void setDrawPointSize( const cpFloat& size );
protected:
cpFloat mDrawPointSize;
#endif
};
}} // namespace EE::Physics
#endif
|
e3458573609cc34ff3a2e16abe49a4ba91e23955 | c13b7be36504e83aa903c71441e60fa35ea3ae52 | /src/Common/SignalSlot.cpp | f8fe78a70883e3a50822c40ac629cea8c5dae5eb | [] | no_license | chinadog/ssp | 716fee04e49916f7969bfac4d7e84e23093c7d41 | be087c0378e863f3906d83adc6e92ba494290ce2 | refs/heads/master | 2018-10-06T08:35:40.500792 | 2018-06-22T13:54:48 | 2018-06-22T13:54:48 | 125,867,895 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 24 | cpp | SignalSlot.cpp | #include "SignalSlot.h"
|
026c6e59714c3f7e58d9d5e4871a5a889522a2e7 | 03805da46a991698f350f7c731192adcd2380efb | /xmastree.ino | 2048bd9cd0a7ff5cd14b2c7ee7ec87fd49f95569 | [] | no_license | constructors/raadhuis-xmastree-arduino | bd6e41328ef1a77626991ae42ef17b7ef305fca4 | ffc4c82c6b788e791ae6cb6337c8e70e340ca994 | refs/heads/master | 2020-06-03T14:22:29.546747 | 2012-12-17T10:47:16 | 2012-12-17T10:47:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,214 | ino | xmastree.ino | #include <SPI.h>
#include <Ethernet.h>
#include <LiquidCrystal.h>
#include <util.h>
// Ethernet config
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(10,233,165,253);
EthernetServer server(2000);
// LCD config
LiquidCrystal lcd(9, 8, 7, 2, 1, 0);
// PWM pins
#define R_PIN 3
#define G_PIN 5
#define B_PIN 6
// PWM min and max levels
#define R_MIN 0L
#define R_MAX 255L
#define G_MIN 0L
#define G_MAX 255L
#define B_MIN 0L
#define B_MAX 255L
// What to view on lcd?
#define SHOW_PWM_VALS false
// Color globals
int current_color[3];
// Init
void setup() {
// Turn off leds
display_color(0, 0, 0);
delay(500);
lcd.begin(16, 2);
lcd.print("Project Xmas3 ");
lcd.setCursor(0,1);
lcd.print("Raadhuis United ");
Ethernet.begin(mac, ip);
server.begin();
// Do led test sequence
delay(1000);
display_color(255, 0, 0);
delay(500);
display_color(0, 0, 0);
delay(500);
display_color(0, 255, 0);
delay(500);
display_color(0, 0, 0);
delay(500);
display_color(0, 0, 255);
delay(500);
display_color(0, 0, 0);
}
// Main loop
void loop() {
int new_color[3];
int new_color_id = 0;
int* color;
unsigned long t_timeout;
/*for(int i = 0;i<255;i++) {
display_color(i, 0, 255-i);
delay(20);
}
for(int i = 0;i<255;i++) {
display_color(255-i, i, 0);
delay(20);
}
for(int i = 0;i<255;i++) {
display_color(0, 255-i, i);
delay(20);
}*/
// listen for incoming connections
EthernetClient client = server.available();
if (client) {
// Suddenly, le wild client connects, send old color
if (client.read() == 's') {
// Client wants to set color
t_timeout = millis()+1000;
while (client.connected()) {
// While the client is connected
if (client.available()) {
// Save byte
new_color[new_color_id++] = client.read();
if (new_color_id == 4) {
// Color received
display_color(new_color[0], new_color[1], new_color[2]);
client.stop();
}
}
if (millis() > t_timeout) {
client.stop();
}
}
} else {
// Client wants to get color
color = get_color();
client.write(color[0]);
client.write(color[1]);
client.write(color[2]);
client.stop();
}
}
}
// Functions
void update_pwm() {
char lcd_buf[17];
int* color = get_color();
int pwm[3];
pwm[0] = R_MIN+(int)(color[0]*(R_MAX-R_MIN)/255);
pwm[1] = G_MIN+(int)(color[1]*(G_MAX-G_MIN)/255);
pwm[2] = B_MIN+(int)(color[2]*(B_MAX-B_MIN)/255);
analogWrite(R_PIN, pwm[0]);
analogWrite(G_PIN, pwm[1]);
analogWrite(B_PIN, pwm[2]);
lcd.setCursor(0,1);
if (SHOW_PWM_VALS) {
sprintf(lcd_buf, "R%03d G%03d B%03d p", pwm[0], pwm[1], pwm[2]);
} else {
sprintf(lcd_buf, "R%03d G%03d B%03d c", color[0], color[1], color[2]);
}
lcd.print(lcd_buf);
}
void set_color(int r_val, int g_val, int b_val) {
current_color[0] = r_val;
current_color[1] = g_val;
current_color[2] = b_val;
}
int* get_color() {
return current_color;
}
void display_color(int r_val, int g_val, int b_val) {
set_color(r_val, g_val, b_val);
update_pwm();
}
|
d4cf3dbe60b34e55c9a815fd0461e6a44f031523 | de3adbc888ad1686e3758ed2d3f27dbef469101d | /projects/Project5/Project-5-Related-Files/rpn.cpp | be6937d8ca3d79d16e3561a75dee8de50ba8f364 | [] | no_license | LouieBHLu/VE280_2020_Summer | 616426593f44ae6990a28ad8274085340d3501c9 | f04309a751924c4cb29833801bf7824870557863 | refs/heads/master | 2023-02-16T01:01:48.077715 | 2021-01-13T12:45:24 | 2021-01-13T12:45:24 | 270,972,820 | 4 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 7,492 | cpp | rpn.cpp | #include "dlist.h"
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
template <class T>
class Stack {
private:
Dlist<T> list;
public:
bool empty(){
if(list.isEmpty()) return true;
else return false;
}
void pop(){
if(list.isEmpty()) return;
T *op = list.removeFront();
delete op;
}
void push(T* val){
//T *op = new T(val);
list.insertFront(val);
}
T* top(){
if(list.isEmpty()) return nullptr;
// Dlist<T> temp(list);
// T *op = temp.removeFront();
// return op;
T *op = list.removeFront();
T *itr = op;
list.insertFront(op);
return itr;
}
~Stack(){
list.~Dlist();
}
};
bool isParenthesis(const string& token){
return token == "(" || token == ")";
}
int cmpPrecedence(const string &token1, const string &token2){
if(token2 == "*" || token2 == "/"){
if(token1 == "+" || token1 == "-") return 1;
else return 0;
}
if(token2 == "+" || token2 == "-"){
if(token1 == "*" || token1 == "/") return -1;
else return 0;
}
return 0;
}
bool isOperater(string &token){
return token == "+" || token == "-" ||
token == "*" || token == "/";
}
int main(int argc, char const *argv[]){
string output = "";
Stack<string> stack;
string token;
string line;
bool error_parent = 0;
// Convert infix expression format into RPN
getline(cin,line);
unsigned int i = 0;
while(i < line.size()){
//clear the token
token = "";
//read a token
while(line[i] != ' ' && i < line.size()){
token += line[i];
i++;
}
i++;
//if token is a operator
if(isOperater(token)){
// While there is an operator token, o2, at the top of the stack AND
// either o1 is left-associative AND its precedence is equal to that of o2,
// OR o1 has precedence less than that of o2,
string o1 = token;
if (!stack.empty()){
string* o2 = stack.top();
//cout << *o2 << endl;
while(isOperater(*o2) && cmpPrecedence(o1,*o2) >= 0){
// pop o2 off the stack, onto the output;
string o2_val = *o2;
output += o2_val;
output += ' ';
stack.pop();
if(!stack.empty()){
o2 = stack.top();
//cout << *o2 << endl;
}
else break;
}
}
//push o1 onto the operator stack
string* new_op = new string(o1);
stack.push(new_op);
//delete new_op;
}
else if(token == "("){
string* new_token = new string(token);
stack.push(new_token);
//delete new_token;
}
else if(token == ")"){
// Until the token at the top of the stack is a left parenthesis,
// pop operators off the stack onto the output queue.
bool lack_pare = 0;
string* topToken = stack.top();
while(*topToken != "("){
string top_val = *topToken;
output += top_val;
output += ' ';
stack.pop();
if(stack.empty()){
lack_pare = true;
break;
}
topToken = stack.top();
}
// If the stack runs out without finding a left parenthesis,
// then there are mismatched parentheses.
if(lack_pare){
cout << "ERROR: Parenthesis mismatch" << endl;
error_parent = 1;
break;
}
if (*topToken != "("){
cout << "ERROR: Parenthesis mismatch" << endl;
error_parent = 1;
break;
}
//Pop the left parenthesis from the stack, but not onto the output
if(!stack.empty()) stack.pop();
}
else{
output += token;
output += ' ';
}
}
// While there are still operator tokens in the stack
while(!stack.empty()){
string *stackToken = stack.top();
// If the operator token on the top of the stack is a parenthesis,
// then there are mismatched parentheses.
if(isParenthesis(*stackToken)){
cout << "ERROR: Parenthesis mismatch" << endl;
error_parent = 1;
break;
}
// Pop the operator onto the output queue./
output += *stackToken;
output += ' ';
stack.pop();
}
//cout the output
if(error_parent) return 0;
else cout << output << endl;
i = 0;
//compute value
bool error_compute = 0;
while(i < output.size()){
//clear the token
token = "";
//read a token
while(output[i] != ' ' && i < output.size()){
//cout << output[i] << endl;
token += output[i];
i++;
}
i++;
//if it's a value, push it onto the stack
if(!isOperater(token)){
string* new_token = new string(token);
stack.push(new_token);
//delete new_token;
}
else{
int result = 0;
// Token is an operator: pop top two entries
if(stack.empty()){
cout << "ERROR: Not enough operands" << endl;
error_compute = 1;
break;
}
string *val2 = stack.top();
double d2 = atof((*val2).c_str());
stack.pop();
if(!stack.empty()){
string *val1 = stack.top();
double d1 = atof((*val1).c_str());
stack.pop();
//Get the result
if(token == "+") result = d1 + d2;
else if(token == "-") result = d1 - d2;
else if(token == "*") result = d1 * d2;
else{
if(d2 == 0){
cout << "ERROR: Divide by zero" << endl;
error_compute = 1;
break;
}
else result = d1 / d2;
}
}
else{
cout << "ERROR: Not enough operands" << endl;
error_compute = 1;
break;
}
// Push result onto stack
ostringstream s;
s << result;
string* new_result = new string(s.str());
stack.push(new_result);
//delete new_result;
}
}
//check if there are still operands in the stack besides the final result
string* result_s = stack.top();
string result_com;
if(result_s != nullptr) result_com = *result_s;
stack.pop();
if(!stack.empty()){
cout << "ERROR: Too many operands" << endl;
error_compute = 1;
return 0;
}
if(!error_compute) cout << result_com << endl;
return 0;
}
|
f7e089742f475420c60292e2a5c93fb28c613943 | b214a48d4853495a0cfb907b239bd7faabb21c88 | /HelperFunctions.cpp | 0087a602a683512233f2e79120deb77c63ed4fde | [] | no_license | farrellrage/CS375_GroupProject | b0b2ee1113dfa591b4c1cb8e8c1f3d444c56153b | ba271ac5671b2bfcadd4d50dbb0f14acc7433a99 | refs/heads/master | 2020-05-16T05:53:36.460135 | 2019-05-05T20:40:09 | 2019-05-05T20:40:09 | 182,829,854 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,944 | cpp | HelperFunctions.cpp | #include "HelperFunctions.h"
//------------------------------------------------------------------------------
//PrintDividerToConsole: Outputs a divider line to the console
//--------------------------------------
// length:
// Length that the divider will be printed as
// character:
// Character that the divider will be consisted of
//------------------------------------------------------------------------------
void PrintDividerToConsole(int length, char character)
{
// Output a divider line to the console
cout << setw(length) << setfill(character) << character << setfill(' ')
<< endl;
} // !PrintDividerToConsole
//------------------------------------------------------------------------------
//PrintDivider: Outputs a divider line to a designated location
//--------------------------------------
// out:
// Output stream object that sends output to the opened output file
// length:
// Length that the divider will be printed as
// character:
// Character that the divider will be consisted of
//------------------------------------------------------------------------------
void PrintDivider(ostream& out, int length, char character)
{
// Output a divider line to the specified destination
out << setw(length) << setfill(character) << character << setfill(' ')
<< endl;
} // !PrintDivider
//------------------------------------------------------------------------------
//PrintCenteredMessage: Outputs a centered message to a designated location
//--------------------------------------
// out:
// Output stream object that sends output to the opened output file
// message:
// String message that will be centered on the given width
// centerWidth:
// Width that the given message will be centered over
//------------------------------------------------------------------------------
void PrintCenteredMessage(ostream& out, string message, int centerWidth)
{
//Holds the value that will center the given message on the given width
int centerOfScreen;
// Calculate the center of the screen for the message
centerOfScreen = static_cast<int>((centerWidth + message.length()) / 2);
// Output the centered message to the specified destination
out << right << setw(centerOfScreen) << message << endl;
} // !PrintCenteredMessage
//------------------------------------------------------------------------------
//VerifyAscending: Outputs a centered message to a designated location
//--------------------------------------
// arr:
//
// size:
//
//------------------------------------------------------------------------------
bool VerifyAscending(int arr[], int size)
{
//For each element in the array
for (int i = 0; i < (size - 1); i++)
{
//Determine whether the current element is larger than the next element
if (arr[i] > arr[i + 1])
{
return false;
} // !if
} // !for
return true;
} // !VerifyAscending
|
db8eda087e9188ccc987333683ee764221c36800 | 1c63316183d546b03aad2dd236a621fcacf0925b | /subsystems/pktsize/PktSizeMon.h | d08477aa8e1b49bcaf86524472643b4b6f02cbce | [] | no_license | sPHENIX-Collaboration/OnlMon | 4540d7aa014e68fc746cdbf85ab6c9857cb96b9d | 0efe29b2c3c366600f65ec08201d0d8eaa8a8a36 | refs/heads/main | 2023-08-18T17:54:39.266304 | 2023-08-16T15:19:28 | 2023-08-16T15:19:28 | 458,877,623 | 0 | 39 | null | 2023-09-14T13:41:32 | 2022-02-13T17:16:59 | C++ | UTF-8 | C++ | false | false | 1,015 | h | PktSizeMon.h | #ifndef __PKTSIZEMON_H__
#define __PKTSIZEMON_H__
#include <onlmon/OnlMon.h>
#include <map>
#include <string>
class Event;
class Packet;
class TH1;
class PktSizeDBodbc;
class PktSizeMon : public OnlMon
{
public:
PktSizeMon(const std::string &name = "PKTSIZEMON");
virtual ~PktSizeMon();
int Init();
int process_event(Event *e);
int Reset();
int EndRun(const int runno);
void Print(const std::string &what = "ALL");
int UpdateDB(const int runno = 0);
// virtual void Verbosity(const int i);
protected:
int putmapinhisto();
int nevnts;
TH1 *sizehist = nullptr;
Packet *plist[10000]{};
PktSizeDBodbc *db;
std::map<unsigned int, unsigned int> packetsize;
std::map<std::string, std::pair<unsigned int, unsigned int> > granulepacketlimits;
std::map<unsigned int, std::string> dcmgroups;
std::map<std::string, unsigned int> dcmgroupsize;
std::map<unsigned int, std::string> fibergroups;
std::map<std::string, unsigned int> fibergroupsize;
};
#endif /* __PKTSIZEMON_H__ */
|
6aff5382d226726d0b91b2f9ff5b97229aa28ac2 | c1950420850836d6e3edf6b080a8aa509b847b91 | /ADOTest/MotorRS.cpp | 56d60828be4489ca45c2d7d117ed04d5cd021d5f | [] | no_license | thyik/adoTest | 795c7d4a10eb6491491c89d23c25ff1200f5c75a | adf9df60b3ce82e2708181554b0388a013066fdb | refs/heads/master | 2022-10-26T17:26:49.609075 | 2020-06-12T06:56:06 | 2020-06-12T06:56:06 | 271,729,287 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 23,279 | cpp | MotorRS.cpp | // Start =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// General information section.
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// $Author:yongkiang$ User who last changed the file
// $Date:1/2/2013 12:16:37 PM$ Date and time of last check in
// $Revision:1.0$ Visual SourceSafe version number
// $Workfile:: MotorRS.cpp $ Filename
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// MotorRS.cpp : implementation file
//
#include "stdafx.h"
#include "MotorRS.h"
//#include "PromptExceptionMessage.h"
//#include "MyStringArray.h"
//#include "DbData.h"
#include "MtrProfileRS.h"
//#include "MultiLanguage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMotorRS
CMotorRS::CMotorRS()
{
// {{AFX_FIELD_INIT(CMotorRS)
m_ID = 0;
m_Module_Name = _T("");
m_Motor_Name = _T("");
m_Position_Name = _T("");
m_Teach_Enable = FALSE;
m_Save_All_Pkg = FALSE;
// m_nFields = 6;
// }}AFX_FIELD_INIT
// m_nDefaultType = dbOpenDynaset;
m_iNoOfModule = 0;
}
CMotorRS::~CMotorRS()
{
Close();
}
CString CMotorRS::GetDefaultDBName()
{
// FIXME
//return _T(MACHINE_DB);
return _T("d:\\machine\\database\\mitmc.mdb");
}
CString CMotorRS::GetDefaultSQL()
{
return _T("[Motor]");
}
//void CMotorRS::DoFieldExchange(CDaoFieldExchange* pFX)
//{
// // {{AFX_FIELD_MAP(CMotorRS)
// pFX->SetFieldType(CDaoFieldExchange::outputColumn);
// DFX_Long(pFX, _T("[ID]"), m_ID);
// DFX_Text(pFX, _T("[Module Name]"), m_Module_Name);
// DFX_Text(pFX, _T("[Motor Name]"), m_Motor_Name);
// DFX_Text(pFX, _T("[Position Name]"), m_Position_Name);
// DFX_Bool(pFX, _T("[Teach Enable]"), m_Teach_Enable);
// DFX_Bool(pFX, _T("[Save All Pkg]"), m_Save_All_Pkg);
// // }}AFX_FIELD_MAP
//}
void CMotorRS::GetAllFieldsValue()
{
m_rs.GetFieldValue(_T("ID"), m_ID);
m_rs.GetFieldValue(_T("Module Name"), m_Module_Name);
m_rs.GetFieldValue(_T("Motor Name"), m_Motor_Name);
m_rs.GetFieldValue(_T("Position Name"), m_Position_Name);
m_rs.GetFieldValue(_T("Teach Enable"), m_Teach_Enable);
m_rs.GetFieldValue(_T("Save All Pkg"), m_Save_All_Pkg);
}
CString CMotorRS::GetConnectionString(CString csDbName)
{
CString strConnectionFormat;
CString strConnection = _T("");
#ifdef _WIN64
//strConnection = _T("Provider=Microsoft.ACE.OLEDB.12.0;Persist Security Info=False;"\
// "Data Source=D:\\Machine\\Database\\MitPkg.mdb");
strConnectionFormat = _T("Provider=Microsoft.ACE.OLEDB.12.0;Persist Security Info=False;"\
"Data Source=");
#else
// for 32-bit process
strConnectionFormat = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";
#endif
//
strConnection = strConnectionFormat + csDbName;
return strConnection;
}
bool CMotorRS::Open(std::string sqlQuery)
{
CString strConnection = _T("");
//
strConnection = GetConnectionString(GetDefaultDBName());
//
m_db.SetConnectionString(strConnection);
if(m_db.Open())
{
if(m_rs.Open(m_db.m_pConnection, sqlQuery.c_str(), CADORecordset::openQuery))
{
return true;
}
}
return false;
}
// set the motor position name from Motor and MotorSubField table
void CMotorRS::SetMtrPosName(stModule *module)
{
CADODatabase db;
try
{
db.Open(GetConnectionString("d:\\machine\\database\\mitmc.mdb")); // open db
CString csSQL;
csSQL.Format("SELECT Motor.*, MotorSubField.SubFieldPosName FROM MotorSubField "
"RIGHT JOIN Motor ON MotorSubField.[Position Name] = Motor.[Position Name] "
"ORDER BY Motor.ID, MotorSubField.ID");
CADORecordset rs(&db);
rs.Open(csSQL); // open record set
rs.MoveFirst(); // move to the first record
rs.MoveLast(); // move to the Last record
int iRecordCnt = rs.GetRecordCount(); // get record count
rs.MoveFirst(); // move to the first record
CString csModuleName;
CString csMtrName;
rs.GetFieldValue("Module Name", csModuleName);
rs.GetFieldValue("Motor Name", csMtrName);
int iModule = GetModuleIndex(module);
int iMtr = 0;
int iPos = 0;
for (int i = 0; i < iRecordCnt; i++)
{
//
rs.GetFieldValue("Module Name",m_Module_Name);
if (m_Module_Name != csModuleName)
{
// next module
csModuleName = m_Module_Name;
iModule = GetModuleIndex(module);
// all parameter need to restart
rs.GetFieldValue("Motor Name",csMtrName);
iMtr = 0;
iPos = 0;
if (iModule < -1 || iModule >= MAX_MODULE)
{
ASSERT(FALSE);
return;
}
}
rs.GetFieldValue("Motor Name", m_Motor_Name);
if (m_Motor_Name != csMtrName)
{
csMtrName = m_Motor_Name;
iMtr++;
if (iMtr < -1 || iMtr >= MAX_MOTOR)
{
ASSERT(FALSE);
return;
}
iPos = 0;
}
CString csVal;
rs.GetFieldValue("Position Name", csVal);
csVal = "Pos: " + csVal;
CString csSubFieldName;
rs.GetFieldValue("SubFieldPosName", csSubFieldName);
if (!csSubFieldName.IsEmpty()) // got sub field position
{
if (iPos == 0 || m_vecMtrPos[iModule][iMtr].at(iPos - 1).Find(csVal) == -1)
{
m_vecMtrPos[iModule][iMtr].push_back(csVal);
}
csVal += ", Sub Field Pos: " + csSubFieldName;
}
m_vecMtrPos[iModule][iMtr].push_back(csVal);
rs.MoveNext(); // move to the next record
}
if (rs.IsOpen()) // if recordset is opened before
{
rs.Close(); // close recordset
}
}
//catch (CDaoException* DaoEx)
//{
// // prompt error
// CPromptExceptionMessage::promptDaoException(DaoEx, "Get Motor Position value from MitMc.mdb");
// DaoEx->Delete(); // must delete to avoid memory leak!
//}
catch (CMemoryException* MemEx)
{
// prompt error
//CPromptExceptionMessage::promptMemoryException(MemEx, "MitMc.mdb");
MemEx->Delete(); // must delete to avoid memory leak!
}
catch (CException *e)
{
e->ReportError();
e->Delete(); // must delete to avoid memory leak!
}
if (db.IsOpen()) // if database is opened before
{
db.Close(); // close database
}
}
// Function to init motor module to maintenance page
void CMotorRS::InitMotorModule(stModule *module)
{
// !!! Note : Need to order BY ID for proper update of "module" structure !!!
std::string strSQL = _T("SELECT * FROM [Motor] ORDER BY ID"); // select all fields from Motor table // ORDER BY [Module Name] ASC");
Open(strSQL); // Creates a new dynaset recordset
if (m_rs.IsEOF()) // check if recordset contains records
{
//CMessageBox Box("No record in motor table");
//Box.DoModal(); // call modal dialog box to prompt the above message
Close(); // close recordset
return;
}
//_unlink("d:\\temp\\motorRS.xml");
//m_rs.SaveAsXML("d:\\temp\\motorRS.xml");
m_rs.MoveFirst(); // move to first record to set the orignal of the db pointer
m_rs.MoveLast(); // move to last record
int iRecordCount = m_rs.GetRecordCount(); // get record count after move to last reord
m_rs.MoveFirst(); // move to first record
// ado2
GetAllFieldsValue();
//
initNoOfMtr(module); // initialised no of motor to 0
int iModule = GetModuleIndex(module);
if (iModule == -1)
{
CString csMessage = m_Module_Name + " Module not found in motor table";
//CMessageBox Box(csMessage);
//Box.DoModal(); // call modal dialog box to prompt the above message
Close(); // close recordset
return;
}
int iMtrArrayNo = 0;
int iPos = 0;
m_vecMtrName.clear();
m_vecMtrName.reserve(MAX_MC_MOTOR);
m_iNoOfModule = 1;
m_csModuleName[iModule] = m_Module_Name; // store module name
m_vecMtrName.push_back(m_Motor_Name); // store motor name
module[iModule].csName = m_Module_Name; // set module name
module[iModule].Motor[iMtrArrayNo] = new CMtrProfile;
module[iModule].Motor[iMtrArrayNo]->m_csMotorName = m_Motor_Name; // set motor name
module[iModule].Motor[iMtrArrayNo]->m_bTeachEnable[iPos] = m_Teach_Enable; // set motor teachable
module[iModule].Motor[iMtrArrayNo]->m_csMotorPos[iPos++] = m_Position_Name; // set position name
for (int i = 1; i < iRecordCount; i++)
{
m_rs.MoveNext(); // move to next record
// ado2
GetAllFieldsValue();
//
if (module[iModule].csName == m_Module_Name) // same module
{
if (module[iModule].Motor[iMtrArrayNo]->m_csMotorName == m_Motor_Name) // same motor
{
module[iModule].Motor[iMtrArrayNo]->m_bTeachEnable[iPos] = m_Teach_Enable; // set motor teachable
module[iModule].Motor[iMtrArrayNo]->m_csMotorPos[iPos++] = m_Position_Name; // set position name
}
else // different motor
{
module[iModule].Motor[iMtrArrayNo]->nNoOfPos = iPos; // set no of pos in one motor
iPos = 0;
iMtrArrayNo++;
module[iModule].Motor[iMtrArrayNo] = new CMtrProfile;
module[iModule].Motor[iMtrArrayNo]->m_csMotorName = m_Motor_Name; // set motor name
module[iModule].Motor[iMtrArrayNo]->m_bTeachEnable[iPos] = m_Teach_Enable; // set motor teachable
module[iModule].Motor[iMtrArrayNo]->m_csMotorPos[iPos++] = m_Position_Name; // set position name
m_vecMtrName.push_back(m_Motor_Name); // store motor name
}
}
else // different module
{
module[iModule].nNoOfMotor = iMtrArrayNo + 1; // set no of motor in the module
module[iModule].Motor[iMtrArrayNo]->nNoOfPos = iPos; // set no of pos in the motor
if (module[iModule].Motor[iMtrArrayNo]->m_csMotorName != m_Motor_Name) // different motor
{
m_vecMtrName.push_back(m_Motor_Name); // store motor name
}
iPos = 0;
iMtrArrayNo = 0;
iModule = GetModuleIndex(module);
m_iNoOfModule++;
m_csModuleName[iModule] = m_Module_Name;
module[iModule].csName = m_Module_Name; // set module name
module[iModule].Motor[iMtrArrayNo] = new CMtrProfile;
module[iModule].Motor[iMtrArrayNo]->m_csMotorName = m_Motor_Name; // set motor name
module[iModule].Motor[iMtrArrayNo]->m_bTeachEnable[iPos] = m_Teach_Enable; // set motor teachable
module[iModule].Motor[iMtrArrayNo]->m_csMotorPos[iPos++] = m_Position_Name; // set position name
}
}
module[iModule].nNoOfMotor = iMtrArrayNo + 1; // set no of motor in the last module
module[iModule].Motor[iMtrArrayNo]->nNoOfPos = iPos; // set no of pos in the last motor module
// move back to first to update m_Module_Name
m_rs.MoveFirst();
// ado2
GetAllFieldsValue();
//
Close(); // close recordset
SetMtrPosName(module);
CMtrProfileRS profileRS;
profileRS.InitMtrProfile(module);
}
// initialised no of motor to 0
void CMotorRS::initNoOfMtr(stModule *module)
{
for (int i = 0; i < MAX_MODULE; i++)
{
module[i].nNoOfMotor = 0;
}
}
// return the module index
int CMotorRS::GetModuleIndex(stModule *module)
{
for (int i = 0; i < MAX_MODULE; i++)
{
if (module[i].csName == m_Module_Name)
{
return i;
}
}
ASSERT(FALSE);
return 0;
}
// return no of module in motor table
int CMotorRS::GetNoOfModule()
{
CString csModuleName;
std::string strSQL = _T("SELECT * FROM [Motor] ORDER BY [Module Name]"); // select all fields from Motor table // ORDER BY [Module Name] ASC");
try
{
Open(strSQL); // Creates a new dynaset recordset
if (m_rs.IsEOF()) // check if recordset contains records
{
//CMessageBox Box(CMultiLanguage::GetMessageText(CMultiLanguage::NO_RECORDS_FOUND_IN_MOTOR_TABLE));
//Box.DoModal(); // call modal dialog box to prompt the above message
Close(); // close recordset
return 0; // return no modules
}
else
{
m_rs.MoveFirst(); // move to first record to set the orignal of the db pointer
m_rs.MoveLast(); // move to last record
int iRecordCount = m_rs.GetRecordCount(); // get record count after move to last reord
// TRACE("iRecordCount = %d\n",iRecordCount);
m_rs.MoveFirst(); // move to first record
// ado2
GetAllFieldsValue();
//
m_iNoOfModule = 1;
csModuleName = m_Module_Name; // store module name
for (int i = 1; i < iRecordCount; i++)
{
// TRACE("module[m_iNoOfModule].csName = %s\n",module[iModule].csName);
m_rs.MoveNext(); // move to next record
// ado2
GetAllFieldsValue();
//
if (csModuleName != m_Module_Name) // same module
{
m_iNoOfModule++;
csModuleName = m_Module_Name; // store module name
}
}
}
}
//catch (CDaoException* DaoEx) // catch CDaoException
//{
// // prompt error
// CPromptExceptionMessage::promptDaoException(DaoEx, "CMotorRS::GetNoOfModule()");
// DaoEx->Delete(); // must delete to avoid memory leak!
//}
catch (CMemoryException* MemEx) // catch Memory exception
{
// prompt error
//CPromptExceptionMessage::promptMemoryException(MemEx, "CMotorRS::GetNoOfModule()");
MemEx->Delete(); // must delete to avoid memory leak!
}
catch (CException *e)
{
e->ReportError();
e->Delete(); // must delete to avoid memory leak!
}
Close(); // close recordset
return m_iNoOfModule;
}
// return module name in motor table
CString* CMotorRS::GetAllModuleName()
{
return m_csModuleName; // return module name in motor table
}
// return motor name in motor table
std::vector<CString> CMotorRS::GetAllMtrName()
{
/* for (int i = 0; i < m_iNoOfMtr; i++)
TRACE("m_csMtrName[%d] = %s\n",i,m_csMtrName[i]);*/
return m_vecMtrName; // return module name in motor table
}
// return no of motor
int CMotorRS::GetNoOfMtr()
{
return m_vecMtrName.size(); // return no of motor in motor table
}
// get motor and pos name
bool CMotorRS::GetMtrAndPosName(stModule *module, int iMtrNo, int iMtrPos, CString &csMtrName, CString &csMtrPos)
{
if (iMtrPos < -1) // invalid motor position
{
// display diagnostic error message : show file name and line number
ASSERT(0);
return false;
}
// have to use this method by comparing the index as read and assign thru database order
for (int i = 0; i < MAX_MODULE; i++)
{
for (int j = 0; j < module[i].nNoOfMotor; j++)
{
if (module[i].Motor[j]->m_iMotorPosArrayIndex == iMtrNo)
// 21 Sep 04 end Gary
{
csMtrName = module[i].Motor[j]->m_csMotorName; // store motor name
if (iMtrPos == -1) // home position
{
csMtrPos = "Home";
}
else if (iMtrPos < m_vecMtrPos[i][j].size()) // valid motor position
{
csMtrPos = m_vecMtrPos[i][j].at(iMtrPos); // store motor position name
}
else // motor position > num of mtr pos store in m_csaMtrPos
{
TRACE("Pos number = %d Mtr Pos No : %d\n",
m_vecMtrPos[i][j].size(), iMtrPos);
return false;
}
return true; // motor position found return to calling function
}
}
}
// display diagnostic error message : show file name and line number
ASSERT(0);
return false;
}
// get motor pos name.
int CMotorRS::GetMtrPosNo(stModule *module, CString csModuleName, int iMtrNo,
CString csMtrPos, CString csSubPosName)
{
m_Module_Name = csModuleName;
int iModule = GetModuleIndex(module);
int iPosArraySize = m_vecMtrPos[iModule][iMtrNo].size();
for (int i = 0; i < iPosArraySize; i++)
{
auto csPosName = m_vecMtrPos[iModule][iMtrNo].at(i);
auto iCharPos = csPosName.Find(csMtrPos);
if (iCharPos > -1)
{
if (!csSubPosName.IsEmpty())
{
if (csPosName.Find(csSubPosName, iCharPos + csMtrPos.GetLength() + 1) > -1)
{
return i;
}
}
else
{
return i;
}
}
}
ASSERT(FALSE);
return 0;
}
// get Save all pkg
BOOL CMotorRS::GetSaveAllPkg(CString csPosName)
{
BOOL bSaveAllPkg = FALSE;
try
{
CString csSQL;
csSQL.Format("SELECT * FROM [Motor] WHERE [Position Name] = \"%s\"", csPosName);
m_rs.Open(csSQL); // Creates a new dynaset recordset
bSaveAllPkg = m_Save_All_Pkg;
}
//catch (CDaoException* DaoEx) // catch CDaoException
//{
// // prompt error
// CString cMsg;
// cMsg.Format("CMotorRS::GetSaveAllPkg() position name = %s", csPosName);
// CPromptExceptionMessage::promptDaoException(DaoEx, cMsg);
// DaoEx->Delete(); // must delete to avoid memory leak!
//}
catch (CMemoryException* MemEx) // catch Memory exception
{
// prompt error
CString cMsg;
cMsg.Format("CMotorRS::GetSaveAllPkg() position name = %s", csPosName);
//CPromptExceptionMessage::promptMemoryException(MemEx, cMsg);
MemEx->Delete(); // must delete to avoid memory leak!
}
catch (CException *e)
{
e->ReportError();
e->Delete(); // must delete to avoid memory leak!
}
Close(); // close recordset
return bSaveAllPkg;
}
// Close Recordset and close database
void CMotorRS::Close()
{
if (m_rs.IsOpen()) // if recordset is open
{
m_rs.Close(); // close recordset
}
if (m_db.IsOpen()) // if database is open
{
m_db.Close(); // close database
}
}
/////////////////////////////////////////////////////////////////////////////
// CMotorRS diagnostics
#ifdef _DEBUG
void CMotorRS::AssertValid() const
{
//CDaoRecordset::AssertValid();
}
void CMotorRS::Dump(CDumpContext& dc) const
{
//CDaoRecordset::Dump(dc);
}
#endif // _DEBUG
int CMotorRS::InitModule(stModule *module)
{
int iRecordCount = 0;
CADODatabase dbModule;
CADORecordset RecordSet(&dbModule);
try
{
dbModule.Open(this->GetConnectionString("d:\\machine\\database\\mitmc.mdb"));
CString csSQL;
csSQL.Format("SELECT * FROM [Module] ORDER BY ID");
RecordSet.Open(csSQL);
if (RecordSet.IsEOF())
{
//CMessageBox Box("No Module Found"));
//Box.DoModal();
}
else
{
RecordSet.MoveFirst(); // move to first record to set the orignal of the db pointer
RecordSet.MoveLast(); // move to last record
iRecordCount = RecordSet.GetRecordCount(); // get record count after move to last reord
// TRACE("\niRecordCount=%d",iRecordCount);
RecordSet.MoveFirst(); // move to first record
for (int i = 0; i < iRecordCount; i++)
{
RecordSet.GetFieldValue("Module Name", module[i].csName);
RecordSet.MoveNext();
// TRACE("\nm_stModule[%d].csName=%s",i,m_stModule[i].csName);
}
}
}
//catch (CDaoException* DaoEx)
//{
// // prompt error
// CPromptExceptionMessage::promptDaoException(DaoEx, "read module to MitMc.mdb",
// "Module Table");
// DaoEx->Delete(); // must delete to avoid memory leak!
//}
catch (CMemoryException* MemEx)
{
// prompt error
//CPromptExceptionMessage::promptMemoryException(MemEx, "MitMc.mdb");
MemEx->Delete();
}
catch (CException *e)
{
e->ReportError();
e->Delete(); // must delete to avoid memory leak!
}
if (RecordSet.IsOpen()) // is record set is opened
{
RecordSet.Close(); // close record set
}
dbModule.Close(); // close data base
return iRecordCount;
}
|
86d9522f6702ad1d5a2dc598df54ca20cc70e738 | 6fe9fbf714fd50f37f136e5e1bdd4788003ec6b8 | /06/matrix.hpp | 125820c409bc022059b81859ee4a463eb1f5bd40 | [] | no_license | sfalll/msu_cpp_autumn_2020 | f5f31b1ec18bae1046f71d017436187f568b4a11 | 9450fa603f326a50336177691fca366362cfc3cc | refs/heads/main | 2023-02-03T03:50:45.910485 | 2020-12-23T19:30:51 | 2020-12-23T19:30:51 | 303,598,634 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 805 | hpp | matrix.hpp | #ifndef MATRIX_HPP
#define MATRIX_HPP
#include <cstddef>
#include <iostream>
class Proxy{
private:
int *data_;
size_t cols_;
public:
Proxy(int *data, size_t cols);
int& operator[](size_t num);
const int& operator[](size_t num) const;
};
class Matrix{
private:
size_t rows_;
size_t cols_;
int *data_;
public:
Matrix(size_t rows, size_t cols, int val=0);
~Matrix();
size_t GetCols() const;
size_t GetRows() const;
friend std::ostream& operator<<(std::ostream& out, const Matrix& m);
Matrix& operator*=(int val);
bool operator==(const Matrix &other) const;
bool operator!=(const Matrix &other) const;
Matrix operator+(const Matrix &other) const;
Proxy operator[](size_t num);
const Proxy operator[](size_t num) const;
};
#endif |
c1692c7b226770259c8801e5156d106822ea31a3 | a3ba6aafb576ebb9dcf7b80972e29baf04d3be44 | /Task1.cpp | b5b3d41e021920a131a525309c84d48f9d026506 | [] | no_license | sergere15/OpenMP_tasks | 7eb07cd58e4f6a9e774b12e06c1f70c1ccd254b9 | 57f0b9be52c9dac3445f12600bb7af3c7d32f4b9 | refs/heads/master | 2020-12-01T20:03:55.546111 | 2020-01-10T13:26:54 | 2020-01-10T13:26:54 | 230,751,797 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,842 | cpp | Task1.cpp |
#include "stdafx.h"
#include <stdio.h>
#include "iostream"
#include "omp.h"
#include "ctime"
#include <dos.h>
const int N = 12000;
const int M = 12900;
int find_min_el_str(int* str,int const M) {
int min = str[0];
for (int i = 0; i < M; i++) {
if (str[i] < min) {
min = str[i];
}
}
return min;
}
int find_max_of_min(int** mas, const int N, const int M, bool parallel) {
int* minimums = new int [N];
omp_set_num_threads(4);
#pragma omp parallel for
for (int i = 0; i < N; i++) {
minimums[i] = find_min_el_str(mas[i], M);
}
int max = minimums[0];
#pragma omp parallel for
for (int i = 0; i < N; i++) {
if (minimums[i] > max)
max = minimums[i];
}
return max;
}
int find_max_of_min(int** mas, const int N, const int M) {
int* minimums = new int[N];
for (int i = 0; i < N; i++) {
minimums[i] = find_min_el_str(mas[i], M);
}
int max = minimums[0];
for (int i = 0; i < N; i++) {
if (minimums[i] > max)
max = minimums[i];
}
return max;
}
int main(){
double start_gen = clock();
int** mas = new int*[N];
for (int i = 0; i < N; i++)
{
mas[i] = new int[M];
for (int j = 0; j < M; j++) {
mas[i][j] = std::rand() % 10000;
}
}
double end_gen = clock();
std::cout << "Generation time:" << (end_gen - start_gen) / CLK_TCK << std::endl;
double start_common = clock();
int max = find_max_of_min(mas, N, M);
double end_common = clock();
std::cout << "Common time:" << (end_common - start_common) / CLK_TCK << " result: " << max << std::endl;
double start = omp_get_wtime();
int maxx = find_max_of_min(mas, N, M, true);
double end = omp_get_wtime();
std::cout << "Paralell time:" << (end - start) << " result: " << maxx << std::endl;
system("pause");
return 0;
}
|
9b47e23a0c50c115878b8a0816c199633d249e7c | 4cdc9a3cc2caff963a25b4711b94ee2a1eeb96bc | /2-Week/mincheol/012.[2836]taxi.cpp | 9f96aa6f248d4dfe5e90e0ba92931cf8faba4bc7 | [] | no_license | futureyoungin/Algorithm-Study | fd9ef3bb4381667a9cf85de71bb12f0c975f0029 | 12f5a4b131fd6d3db90f61afd1cde02112450008 | refs/heads/master | 2023-04-03T05:22:55.247055 | 2021-03-30T14:53:10 | 2021-03-30T14:53:10 | 324,511,868 | 0 | 1 | null | 2021-03-19T05:46:05 | 2020-12-26T08:19:42 | C++ | UTF-8 | C++ | false | false | 794 | cpp | 012.[2836]taxi.cpp | #include <stdio.h>
#include <algorithm>
using namespace std;
int N,M,i,idx=0;
long long ans;
pair<int,int> arr[300000];
void drive(){
int start_i = arr[0].first;
int end_i = arr[0].second;
for(i=1; i<idx; i++){
if( arr[i].first>end_i ){
ans += (end_i-start_i)*2;
start_i = arr[i].first;
end_i = arr[i].second;
}else{
if( arr[i].second>end_i ) end_i = arr[i].second;
}
}
ans += (end_i-start_i)*2;
}
int main(){
scanf("%d %d", &N, &M);
ans = M;
int a,b;
for(i=0; i<N; i++){
scanf("%d %d", &arr[idx].second, &arr[idx].first);
if( arr[idx].second>arr[idx].first ) idx++;
}
sort(arr, arr+idx);
if( idx>0 ) drive();
printf("%lld\n", ans);
return 0;
}
|
88c4e027afe91a0c1f5fedda59c65b67e79b4a5a | e37cd1426768ceac0cd30ff8c4b7acc4513b8b7b | /src/interface/board/Grid.cpp | a1fb3a6e6690b16c1d47f84909541cc4b7a43175 | [] | no_license | JanWalsh91/Gomoku | 1bd44f2da2f80e3f8f4076d599f99159c78ff004 | f3502dff465341a202f147af3f7201d0be356fe8 | refs/heads/master | 2020-05-26T22:45:41.658323 | 2019-08-23T10:00:36 | 2019-08-23T10:00:36 | 188,402,377 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,259 | cpp | Grid.cpp | #include "Grid.hpp"
#include <iostream>
Grid::Grid(int nbCells, float boardSize, float margin) : _nbCells(nbCells), _boardSize(boardSize), _margin(margin) {
_size = sf::Vector2f(boardSize, boardSize);
_cellSize = (boardSize - _margin * 2) / (nbCells + 1);
for (int i = 0; i < nbCells + 2; i++) {
auto Hline = std::make_shared<sf::RectangleShape>(sf::Vector2f(boardSize - _margin * 2, 1));
Hline->move(_margin, _margin + (i * _cellSize));
auto Vline = std::make_shared<sf::RectangleShape>(sf::Vector2f(boardSize - _margin * 2, 1));
Vline->move(_margin + (i * _cellSize), _margin);
Vline->rotate(90.0f);
_gridLines.push_back(Hline);
_gridLines.push_back(Vline);
}
if (_blackStoneTexture.loadFromFile("resources/textures/black_stone.png")) {
_blackStoneTexture.setSmooth(false);
}
if (_whiteStoneTexture.loadFromFile("resources/textures/white_stone.png")) {
_whiteStoneTexture.setSmooth(false);
}
}
/**
Places a stone at the position pos. Pos reprensents the indices in the grid (0, 0), (1, 2), ...
*/
void Grid::placeStoneAt(std::pair<int, int> pos, sf::Color color) {
if (pos.first < 0 || pos.second < 0 || pos.first >= _nbCells || pos.second >= _nbCells) {
std::cerr << "Error, wrong position" << std::endl;
return ;
}
auto stone = std::make_shared<sf::CircleShape>(_cellSize / 2.0f);
stone->move(_margin + (pos.second * _cellSize) + _cellSize / 2.0f, _margin + (pos.first * _cellSize) + _cellSize / 2.0f);
if (color == sf::Color::Black) {
stone->setTexture(&_blackStoneTexture);
}
else {
stone->setTexture(&_whiteStoneTexture);
}
stone->setTextureRect(sf::IntRect(0, 0, 545, 545));
_stones[pos] = stone;
}
void Grid::removeStoneAt(std::pair<int, int> pos) {
_stones.erase(pos);
}
std::pair<int, int> Grid::windowToGridCoord(sf::Vector2i mousePosition) {
if (mousePosition.x < _margin * 1.5f || mousePosition.y < _margin * 1.5f || mousePosition.x > _boardSize - _margin * 1.5f || mousePosition.y > _boardSize - _margin * 1.5f) {
return std::make_pair(-1, -1);
}
return std::make_pair(static_cast<int>((mousePosition.y / _cellSize) - _margin / _cellSize - 0.5f), static_cast<int>((mousePosition.x / _cellSize) - _margin / _cellSize - 0.5f));
}
void Grid::render(sf::RenderWindow& window) {
for (auto& line : _gridLines) {
window.draw(*line);
}
for (auto& stone : _stones) {
window.draw(*stone.second);
}
}
void Grid::click(sf::Vector2i mousePosition) {
if (mousePosition.x < 800 && mousePosition.y < 800) {
for (auto& callback : clickCallbacks) {
callback(mousePosition);
}
}
}
void Grid::hover(sf::Vector2i mousePosition) {
if (mousePosition.x < 800 && mousePosition.y < 800) {
auto pos = this->windowToGridCoord(mousePosition);
if (pos.first < 0 || pos.second < 0 || pos.first >= _nbCells || pos.second >= _nbCells || _stones.find(pos) != _stones.end()) {
return;
}
float xPosition = _margin + (pos.first * _cellSize) + _cellSize / 2.0f;
float yPosition = _margin + (pos.second * _cellSize) + _cellSize / 2.0f;
for (auto& callback : hoverCallbacks) {
callback(sf::Vector2i(static_cast<int>(xPosition), static_cast<int>(yPosition)));
}
}
}
float Grid::getCellSize() const {
return _cellSize;
}
void Grid::reset() {
_stones.clear();
} |
bfff73e6067b35398a137fd51fa02e3c4e0b9be1 | b121c505c14add6cce20fd96008aeaf6377a95eb | /AStar/Client/Time_Manager.cpp | a208ef6cf145e1751fedc75a202a44496b063b86 | [] | no_license | Aeopp/A-Star | 0156af9b4e9393dad02301cd1c97570bf50d046e | bf8d72f04ca8b7e34af8bbf6b3e6a59a2b987184 | refs/heads/master | 2023-01-01T08:09:18.220182 | 2020-10-20T09:53:20 | 2020-10-20T09:53:20 | 305,631,337 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 763 | cpp | Time_Manager.cpp | #include "stdafx.h"
#include "Time_Manager.h"
IMPLEMENT_SINGLETON(CTime_Manager)
CTime_Manager::CTime_Manager()
{
}
CTime_Manager::~CTime_Manager()
{
}
float CTime_Manager::Get_TimeDelta()
{
return m_fTimeDelta;
}
HRESULT CTime_Manager::Ready_TimeManager()
{
QueryPerformanceCounter(&m_BeginTime);
QueryPerformanceCounter(&m_EndTime);
QueryPerformanceFrequency(&m_CPUTick);
m_fTimeDelta = 0.f;
return S_OK;
}
void CTime_Manager::Compute_TimeManager()
{
QueryPerformanceCounter(&m_EndTime);
if (m_fInitTime > 1)
{
QueryPerformanceFrequency(&m_CPUTick);
m_fInitTime = 0.f;
}
m_fTimeDelta = float(m_EndTime.QuadPart - m_BeginTime.QuadPart) / m_CPUTick.QuadPart;
m_fInitTime += m_fTimeDelta;
m_BeginTime.QuadPart = m_EndTime.QuadPart;
}
|
e50256377e913d0362d16743504f017aea7aef17 | 2ae0b8d95d439ccfd55ea7933ad4a2994ad0f6c5 | /src/plugins/intel_gpu/tests/functional/single_layer_tests/dynamic/reduce.cpp | 7ce1d51e32a9b601e905d50ad7e414254dba9e5b | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | openvinotoolkit/openvino | 38ea745a247887a4e14580dbc9fc68005e2149f9 | e4bed7a31c9f00d8afbfcabee3f64f55496ae56a | refs/heads/master | 2023-08-18T03:47:44.572979 | 2023-08-17T21:24:59 | 2023-08-17T21:24:59 | 153,097,643 | 3,953 | 1,492 | Apache-2.0 | 2023-09-14T21:42:24 | 2018-10-15T10:54:40 | C++ | UTF-8 | C++ | false | false | 11,296 | cpp | reduce.cpp | // Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "shared_test_classes/single_layer/reduce_ops.hpp"
#include "shared_test_classes/base/ov_subgraph.hpp"
#include "ie_precision.hpp"
#include "ngraph_functions/builders.hpp"
#include <string>
using namespace ngraph;
using namespace InferenceEngine;
using namespace ov::test;
namespace GPULayerTestsDefinitions {
typedef struct {
std::vector<InputShape> data_shape;
std::vector<int> axes;
} ReduceInput;
typedef std::tuple<
ReduceInput, // input data (data shape, axes shape, axes values)
ElementType, // presion of inputs
helpers::ReductionType, // reduction type
bool, // keepDims
TargetDevice // device name
> ReduceLayerTestParamSet;
class ReduceLayerGPUTest : public testing::WithParamInterface<ReduceLayerTestParamSet>,
virtual public SubgraphBaseTest {
public:
static std::string getTestCaseName(const testing::TestParamInfo<ReduceLayerTestParamSet>& obj) {
ReduceInput input_data;
ElementType netType;
helpers::ReductionType reductionType;
bool keepDims;
TargetDevice targetDevice;
std::tie(input_data, netType, reductionType, keepDims, targetDevice) = obj.param;
std::vector<InputShape> inshapes = input_data.data_shape;
std::vector<int> axes = input_data.axes;
std::ostringstream result;
result << "IS=";
for (const auto& shape : inshapes) {
result << ov::test::utils::partialShape2str({shape.first}) << "_";
}
result << "TS=";
for (const auto& shape : inshapes) {
for (const auto& item : shape.second) {
result << ov::test::utils::vec2str(item) << "_";
}
}
result << "axes=";
result << ov::test::utils::vec2str(axes) << "_";
result << "Precision=" << netType << "_";
result << "reductionType=" << reductionType << "_";
result << "keepDims=" << keepDims << "_";
result << "trgDev=" << targetDevice;
return result.str();
}
protected:
void SetUp() override {
ReduceInput input_data;
ElementType netPrecision;
helpers::ReductionType reductionType;
bool keepDims;
std::tie(input_data, netPrecision, reductionType, keepDims, targetDevice) = this->GetParam();
std::vector<InputShape> inputShapes = input_data.data_shape;
std::vector<int> axes = input_data.axes;
init_input_shapes(inputShapes);
auto params = ngraph::builder::makeDynamicParams(netPrecision, inputDynamicShapes);
auto paramOuts = ngraph::helpers::convert2OutputVector(
ngraph::helpers::castOps2Nodes<ngraph::op::Parameter>(params));
std::vector<size_t> shapeAxes;
shapeAxes.push_back(axes.size());
auto reductionAxesNode = std::dynamic_pointer_cast<ngraph::Node>(
std::make_shared<ngraph::opset3::Constant>(ngraph::element::Type_t::i64, ngraph::Shape(shapeAxes), axes));
const auto reduce = ngraph::builder::makeReduce(paramOuts[0], reductionAxesNode, keepDims, reductionType);
auto makeFunction = [](ParameterVector ¶ms, const std::shared_ptr<Node> &lastNode) {
ResultVector results;
for (size_t i = 0; i < lastNode->get_output_size(); i++)
results.push_back(std::make_shared<opset1::Result>(lastNode->output(i)));
return std::make_shared<Function>(results, params, "ReduceLayerGPUTest");
};
function = makeFunction(params, reduce);
}
};
TEST_P(ReduceLayerGPUTest, CompareWithRefs) {
SKIP_IF_CURRENT_TEST_IS_DISABLED()
run();
}
namespace {
const std::vector<bool> keepDims = {
true,
false,
};
const std::vector<ElementType> floatPrecisions = {
ElementType::f32,
ElementType::f16,
};
const std::vector<ElementType> floatIntPrecisions = {
ElementType::f32,
ElementType::f16,
ElementType::i32,
};
namespace Reduce {
const ReduceInput dyn1d = {
{
{ {-1}, {{4}, {5}} }
},
{0}
};
const ReduceInput dyn2d = {
{
{ {-1, -1}, {{100, 3}, {5, 6}} }
},
{1}
};
const ReduceInput dyn3d = {
{
{ {-1, -1, -1}, {{4, 5, 6}, {5, 1, 6}} }
},
{0, -1}
};
const ReduceInput dyn4d = {
{
{ {-1, -1, -1, -1}, {{2, 3, 4, 5}, {5, 4, 3, 1}} }
},
{1, -2}
};
const ReduceInput dyn5d = {
{
{ {-1, -1, -1, -1, -1}, {{2, 3, 4, 5, 6}, {5, 6, 3, 1, 2}} }
},
{-3, 3}
};
const ReduceInput dyn6d = {
{
{ {-1, -1, -1, -1, -1, -1}, {{2, 3, 4, 5, 6, 7}, {5, 4, 3, 1, 2, 6}} }
},
{1}
};
// ================== Reduction int32/float types (Sum, Min, Max, L1) ==================
const auto reduceSum = ::testing::Combine(
::testing::ValuesIn({dyn1d, dyn5d}),
::testing::ValuesIn(floatIntPrecisions),
::testing::Values(helpers::ReductionType::Sum),
::testing::ValuesIn(keepDims),
::testing::Values(ov::test::utils::DEVICE_GPU)
);
INSTANTIATE_TEST_SUITE_P(smoke_reduce_sum_compareWithRefs_dynamic, ReduceLayerGPUTest, reduceSum, ReduceLayerGPUTest::getTestCaseName);
const auto reduceMin = ::testing::Combine(
::testing::ValuesIn({dyn2d, dyn6d}),
::testing::ValuesIn(floatIntPrecisions),
::testing::Values(helpers::ReductionType::Min),
::testing::ValuesIn(keepDims),
::testing::Values(ov::test::utils::DEVICE_GPU)
);
INSTANTIATE_TEST_SUITE_P(smoke_reduce_min_compareWithRefs_dynamic, ReduceLayerGPUTest, reduceMin, ReduceLayerGPUTest::getTestCaseName);
const auto reduceMax = ::testing::Combine(
::testing::ValuesIn({dyn3d, dyn5d}),
::testing::ValuesIn(floatIntPrecisions),
::testing::Values(helpers::ReductionType::Max),
::testing::ValuesIn(keepDims),
::testing::Values(ov::test::utils::DEVICE_GPU)
);
INSTANTIATE_TEST_SUITE_P(smoke_reduce_max_compareWithRefs_dynamic, ReduceLayerGPUTest, reduceMax, ReduceLayerGPUTest::getTestCaseName);
const auto reduceL1 = ::testing::Combine(
::testing::ValuesIn({dyn4d, dyn6d}),
::testing::ValuesIn(floatIntPrecisions),
::testing::Values(helpers::ReductionType::L1),
::testing::ValuesIn(keepDims),
::testing::Values(ov::test::utils::DEVICE_GPU)
);
INSTANTIATE_TEST_SUITE_P(smoke_reduce_l1_compareWithRefs_dynamic, ReduceLayerGPUTest, reduceL1, ReduceLayerGPUTest::getTestCaseName);
// ================== Reduction float types (Mean, Prod, L2) ==================
const auto reduceMean = ::testing::Combine(
::testing::ValuesIn({dyn1d, dyn6d}),
::testing::ValuesIn(floatPrecisions),
::testing::Values(helpers::ReductionType::Mean),
::testing::ValuesIn(keepDims),
::testing::Values(ov::test::utils::DEVICE_GPU)
);
INSTANTIATE_TEST_SUITE_P(smoke_reduce_mean_compareWithRefs_dynamic, ReduceLayerGPUTest, reduceMean, ReduceLayerGPUTest::getTestCaseName);
const auto reduceProd = ::testing::Combine(
::testing::ValuesIn({dyn2d, dyn4d}),
::testing::ValuesIn({ElementType::f32}),
::testing::Values(helpers::ReductionType::Prod),
::testing::ValuesIn(keepDims),
::testing::Values(ov::test::utils::DEVICE_GPU)
);
INSTANTIATE_TEST_SUITE_P(smoke_reduce_prod_compareWithRefs_dynamic, ReduceLayerGPUTest, reduceProd, ReduceLayerGPUTest::getTestCaseName);
const auto reduceL2 = ::testing::Combine(
::testing::ValuesIn({dyn4d, dyn5d}),
::testing::ValuesIn(floatPrecisions),
::testing::Values(helpers::ReductionType::L2),
::testing::ValuesIn(keepDims),
::testing::Values(ov::test::utils::DEVICE_GPU)
);
INSTANTIATE_TEST_SUITE_P(smoke_reduce_l2_compareWithRefs_dynamic, ReduceLayerGPUTest, reduceL2, ReduceLayerGPUTest::getTestCaseName);
// ================== Reduction logical types (LogicalOr, LogicalAnd) ==================
const auto reduceLogicalOr = ::testing::Combine(
::testing::ValuesIn({dyn1d, dyn6d}),
::testing::Values(ElementType::boolean),
::testing::Values(helpers::ReductionType::LogicalOr),
::testing::ValuesIn(keepDims),
::testing::Values(ov::test::utils::DEVICE_GPU)
);
INSTANTIATE_TEST_SUITE_P(smoke_reduce_logicalor_compareWithRefs_dynamic, ReduceLayerGPUTest, reduceLogicalOr, ReduceLayerGPUTest::getTestCaseName);
const auto reduceLogicalAnd = ::testing::Combine(
::testing::ValuesIn({dyn3d, dyn5d}),
::testing::Values(ElementType::boolean),
::testing::Values(helpers::ReductionType::LogicalAnd),
::testing::ValuesIn(keepDims),
::testing::Values(ov::test::utils::DEVICE_GPU)
);
INSTANTIATE_TEST_SUITE_P(smoke_reduce_logicaland_compareWithRefs_dynamic, ReduceLayerGPUTest, reduceLogicalAnd, ReduceLayerGPUTest::getTestCaseName);
// ================== various reduce-axis ==================
const std::vector<ReduceInput> dynVariousAxisInputs = {
// 4D
{
{
{ {-1, -1, -1, -1}, {{2, 3, 4, 5}, {5, 4, 3, 1}} }
},
{0}
},
{
{
{ {-1, -1, -1, -1}, {{2, 3, 4, 5}, {5, 4, 3, 1}} }
},
{1, -1}
},
{
{
{ {-1, -1, -1, -1}, {{2, 3, 4, 5}, {5, 3, 7, 1}} }
},
{2, 3}
},
{
{
{ {-1, -1, -1, -1}, {{2, 3, 4, 5}, {1, 2, 3, 1}} }
},
{0, 2, -1}
},
// 5D
{
{
{ {-1, -1, -1, -1, -1}, {{2, 4, 3, 4, 5}, {5, 3, 2, 1, 2}} }
},
{1}
},
{
{
{ {-1, -1, -1, -1, -1}, {{4, 3, 2, 5, 6}, {5, 3, 2, 1, 4}} }
},
{0, -3}
},
{
{
{ {-1, -1, -1, -1, -1}, {{3, 4, 2, 6, 5}, {3, 5, 7, 1, 5}} }
},
{2, -2, 4}
},
{
{
{ {-1, -1, -1, -1, -1}, {{4, 2, 5, 1, 9}, {5, 3, 7, 1, 2}} }
},
{0, 1, -2, 4}
},
// 6D
{
{
{ {-1, -1, -1, -1, -1, -1}, {{2, 3, 4, 5, 6, 7}, {5, 3, 4, 1, 7, 5}} }
},
{0}
},
{
{
{ {-1, -1, -1, -1, -1, -1}, {{2, 3, 4, 5, 6, 7}, {5, 3, 5, 1, 2, 5}} }
},
{0, -3}
},
{
{
{ {-1, -1, -1, -1, -1, -1}, {{2, 3, 4, 5, 6, 7}, {2, 5, 4, 1, 5, 3}} }
},
{2, 3, -2, 5}
},
{
{
{ {-1, -1, -1, -1, -1, -1}, {{2, 3, 4, 5, 6, 7}, {3, 5, 4, 1, 8, 5}} }
},
{0, 2, -3, 4, 5}
},
{
{
{ {-1, -1, -1, -1, -1, -1}, {{2, 3, 4, 5, 6, 7}, {7, 5, 3, 1, 6, 9}} }
},
{4}
},
};
const auto reduceMaxWithVariousAxis = ::testing::Combine(
::testing::ValuesIn(dynVariousAxisInputs),
::testing::Values(ElementType::f32),
::testing::Values(helpers::ReductionType::Max),
::testing::ValuesIn(keepDims),
::testing::Values(ov::test::utils::DEVICE_GPU)
);
INSTANTIATE_TEST_SUITE_P(smoke_reduce_max_withVariousAxis_compareWithRefs_dynamic,
ReduceLayerGPUTest, reduceMaxWithVariousAxis, ReduceLayerGPUTest::getTestCaseName);
} // namespace Reduce
} // namespace
} // namespace GPULayerTestsDefinitions
|
ed0a943c6f90e9c429101e03eb0c952847c93420 | a84758976f7d203cd0e005f96d0161351d2e943e | /src/bmp.cpp | 744c2219ad6727b4a82e5f7675dcb4b78ed2070d | [] | no_license | zmyme/BmpGenerator | 579081b0409fde44125ddd21db683879853c508a | d7051b6514db7f29d6c55a208f55fef59d663a81 | refs/heads/master | 2021-06-18T20:09:18.107233 | 2017-07-03T03:54:29 | 2017-07-03T03:54:29 | 73,918,848 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,115 | cpp | bmp.cpp | #include <vector>
#include "bmp.h"
inline INT_32 Palette::GetColor(INT_8 b,INT_8 g,INT_8 r)
{
INT_32 temp=0x00000000;
temp=(temp|(INT_32) b);
temp=(temp<<8|(INT_32) g);
temp=(temp<<8|(INT_32) r);
return temp;
}
// inline Palette Palette::GetPalette(INT_32 color)
// {
// Palette temp(color);
// return temp;
// }
// inline Palette Palette::GetPalette(INT_8 b,INT_8 g,INT_8 r)
// {
// Palette temp(b,g,r);
// return temp;
// }
int Bmp::SetSize(INT_32 width, INT_32 height)
{
if(data==NULL)
{
InitFileHeader();
InitInfoHeader();
file.bfSize=((width*3+3)/4)*4*height+file.bfOffbits;
info.biWidth=width;
info.biHeight=height;
data = new Palette[width*height];
return 0;
}
else
{
return -1;
}
}
int Bmp::load(const char *path)
{
if(data!=NULL)
{
return -1;
}
std::fstream pic;
pic.open(path,std::ios::binary|std::ios::in);
if(pic.is_open()==0)
{
std::cout<<"Open file "<<path<<" failed"<< std::endl;
return -1;
}
pic.read((char *) &file,sizeof(BmpFileHeader));
pic.read((char *) &info,sizeof(BmpInfoHeader));
data = new Palette[info.biWidth*info.biHeight];
for(INT_32 i=info.biHeight-1;i>=0;i--)
{
INT_32 SizePerLine=((info.biWidth*3+3)/4)*4;
char *buffer = new char[SizePerLine];
pic.read(buffer,SizePerLine);
std::memcpy(data+info.biWidth*i,buffer,sizeof(Palette)*info.biWidth);
}
pic.close();
return 0;
}
int Bmp::write(const char *path)
{
std::fstream temp;
temp.open(path,std::ios::binary|std::ios::out|std::ios::trunc);
if(temp.is_open()==0)
{
std::cout<<"Open File "<<path<<" failed!"<< std::endl;
return -1;
}
temp.write((char *) &file,sizeof(BmpFileHeader));
temp.write((char *) &info,sizeof(BmpInfoHeader));
for(INT_32 i=info.biHeight-1;i>=0;i--)
{
INT_32 SizePerLine=((info.biWidth*3+3)/4)*4;
char *buffer = new char[SizePerLine];
std::memcpy(buffer,data+info.biWidth*i,sizeof(Palette)*info.biWidth);
temp.write(buffer,SizePerLine);
}
temp.close();
return 0;
}
Palette Bmp::getpixel(INT_32 x,INT_32 y)
{
Palette color;
if(x>=0&&y>=0&&x<info.biWidth&&y<info.biHeight)
{
color=*(data+y*info.biWidth+x);
}
return color;
}
INT_32 Palette::TellColor(void)
{
return GetColor(Blue,Green,Red);
}
int Bmp::line(INT_32 x1,INT_32 y1,INT_32 x2,INT_32 y2,int thickness,Palette color)
{
INT_32 dx=x2-x1;
INT_32 dy=y2-y1;
INT_32 ux=((dx>0)<<1)-1;
INT_32 uy=((dy>0)<<1)-1;
INT_32 x=x1,y=y1,eps=0;
dx=dx>0?dx:0-dx;
dy=dy>0?dy:0-dy;
if(dx>dy)
{
for(x=x1;x!=x2;x+=ux)
{
for(int i=0-thickness/2;i<=thickness/2;i++)
{
pixel(x,y+i,color);
}
eps+=dy;
if((eps<<1)>=dx)
{
y+=uy;
eps-=dx;
}
}
}
else
{
for(y=y1;y!=y2;y+=uy)
{
for(int i=0-thickness/2;i<=thickness/2;i++)
{
pixel(x+i,y,color);
}
eps+=dx;
if((eps<<1)>=dy)
{
x+=ux;
eps-=dy;
}
}
}
return 0;
}
int Bmp::rectangle(INT_32 x1,INT_32 y1,INT_32 x2,INT_32 y2,int thickness,Palette color)
{
line(x1-thickness/2,y1,x2+thickness/2,y1,thickness,color);
line(x1-thickness/2,y2,x2+thickness/2,y2,thickness,color);
line(x1,y1-thickness/2,x1,y2+thickness/2,thickness,color);
line(x2,y1-thickness/2,x2,y2+thickness/2,thickness,color);
return 0;
}
int Bmp::bar(INT_32 x1,INT_32 y1,INT_32 x2,INT_32 y2,Palette color)
{
for(INT_32 i=x1;i<=x2;i++)
{
line(i,y1,i,y2,1,color);
}
return 0;
}
int Bmp::circle(INT_32 x,INT_32 y,INT_32 r,Palette color)
{
int x0=0,y0=r;
int d=1-r;
while(y0>x0)
{
pixel(x0+x,y0+y,color);
pixel(y0+x,x0+y,color);
pixel(-x0+x,y0+y,color);
pixel(-y0+x,x0+y,color);
pixel(-x0+x,-y0+y,color);
pixel(-y0+x,-x0+y,color);
pixel(x0+x,-y0+y,color);
pixel(y0+x,-x0+y,color);
if(d<0)
d=d+2*x0+3;
else
{
d=d+2*(x0-y0)+5;
y0--;
}
x0++;
}
return 0;
}
int Bmp::resize(int NewWidth,int NewHeight)
{
int OldWidth=width();
int OldHeight=height();
Palette *newdata = NULL;
newdata = new Palette[NewWidth*NewHeight];
for(int i=0;i<NewWidth;i++)
{
for(int j=0;j<NewHeight;j++)
{
PixelOnPointer(i,j,getpixel((i*OldWidth)/NewWidth,(j*OldHeight)/NewHeight),newdata,NewWidth,NewHeight);
}
}
delete[] data;
data = newdata;
info.biWidth = NewWidth;
info.biHeight = NewHeight;
return 0;
}
int Bmp::resize(float percent)
{
int NewWidth = width()*percent;
int NewHeight = height()*percent;
resize(NewWidth,NewHeight);
return 0;
}
|
c292604b7d0932db47739c42f53e8febc0c15d7b | b2d45ac654182c2ed0f273fb1461aef58f5b20f4 | /ParkingTicketSimulator/ParkingTicketSimulator/ParkingMeter.cpp | adc028d6ee48f639e213cd828349d21ed2b3fb03 | [] | no_license | James-Alexandr/ParkingTicketSimulator | de24978b1b8b4e1b9ee0a16fb9d2130e06902e37 | 1cf972b2ea76daeec503d8feda66676860ee4468 | refs/heads/main | 2023-02-20T21:06:28.050609 | 2021-01-19T16:34:09 | 2021-01-19T16:34:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 903 | cpp | ParkingMeter.cpp | // Specification file for the ParkingMeter class
#ifndef PARKING_METER_H
#define PARKING_METER_H
#include <iostream>
using namespace std;
// ParkingMeter class
class ParkingMeter
{
private:
int minutesPurchased; // Minutes purchased
public:
// Default constructor
ParkingMeter()
{
minutesPurchased = 0;
}
// Constructor. The parameter m is
// the number of minutes purchased.
ParkingMeter(int m)
{
minutesPurchased = m;
}
// Mutator
void setMinutesPurchased(int m)
{
minutesPurchased = m;
}
// Accessor
int getMinutesPurchased() const
{
return minutesPurchased;
}
// print function
void print()
{
cout << "Meter Information:\n";
cout << "\tMinutes Purchases: "
<< minutesPurchased << endl;
}
};
#endif |
3576a4ef27d2f187e95bf91443c31423d3ef8999 | d28e013c718091502ceae29597e9e7d781834b53 | /Ultimate/src/mod/events/GenericEvent.h | 8574c422c8ca69ec32dd7dd6dd8fb73a2a3a25eb | [] | no_license | Scoudcorp/Ultimate | f0a1d1be32c4a86c08e4c317f077e6c907011257 | 06bc77ddb58766f346067cb40796fe268b85beb0 | refs/heads/master | 2021-06-04T08:15:49.625160 | 2019-05-15T08:22:00 | 2019-05-15T08:22:00 | 136,847,174 | 20 | 12 | null | 2021-02-16T12:52:47 | 2018-06-10T21:45:11 | C++ | UTF-8 | C++ | false | false | 276 | h | GenericEvent.h | #pragma once
#include "Event.h"
class GenericEvent: public Event
{
using GenericCallback = void(*)();
GenericCallback m_callback;
public:
GenericEvent(const GenericCallback callback)
: m_callback(callback)
{
}
void execute() override;
};
|
230917c5284a7fcca76aadfdcb178275ad62f5a6 | 09221a853ac053fbdf3f8419a80c7cc5fe707a10 | /a1/matrix.cpp | 3a69ed6f06d675bbf6918993972ba6e539bc360c | [] | no_license | Jbudone/CSC305-Graphics | 9f02c2436ba4a05da35352e87f86309aa756a5d7 | 88d649491fd7be9755277bcbd6d1f1317e1201e7 | refs/heads/master | 2020-04-04T19:44:11.874236 | 2013-05-05T21:53:41 | 2013-05-05T21:53:41 | 8,000,142 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 582 | cpp | matrix.cpp | #include "matrix.h"
Matrix3x3::Matrix3x3()
{
this->loadIdentity();
}
void Matrix3x3::loadIdentity()
{
elements[0] = elements[4] = elements[8] = 1;
elements[1] = elements[2] = elements[3] = elements[5] = elements[6] = elements[7] = 0;
}
Matrix4x4::Matrix4x4()
{
loadIdentity();
}
void Matrix4x4::loadIdentity()
{
elements[0] = elements[5] = elements[10] = elements[15] = 1;
elements[1] = elements[2] = elements[3] = elements[4] = elements[6] = elements[7]
= elements[8] = elements[9] = elements[11] = elements[12] = elements[13] = elements[14] = 0;
}
|
f2c47e9fad09239ceb877c1b2bbcb1d856096d10 | 084a264ee1c2f1d36db03988970cdedc1846799a | /sdk/android/src/jni/videoencoderfactorywrapper.cc | 5bb904769ae572f42e04c9c5eff4633e7b2e23b7 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-google-patent-license-webm",
"LicenseRef-scancode-google-patent-license-webrtc",
"GPL-1.0-or-later",
"LicenseRef-scancode-takuya-ooura",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown",
"MS-LPL",... | permissive | nareix/webrtc | 199410db65e18c1b277d50484673b9ffab54b124 | 123749a69270b2c0bf232887c3cf1cf6d03d016a | refs/heads/main | 2023-04-20T09:39:56.531907 | 2023-03-10T11:01:52 | 2023-03-10T11:01:52 | 214,553,776 | 0 | 1 | MIT | 2019-10-12T01:08:20 | 2019-10-12T01:08:19 | null | UTF-8 | C++ | false | false | 4,429 | cc | videoencoderfactorywrapper.cc | /*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "sdk/android/src/jni/videoencoderfactorywrapper.h"
#include "api/video_codecs/video_encoder.h"
#include "common_types.h" // NOLINT(build/include)
#include "rtc_base/logging.h"
#include "sdk/android/src/jni/classreferenceholder.h"
#include "sdk/android/src/jni/videoencoderwrapper.h"
namespace webrtc {
namespace jni {
VideoEncoderFactoryWrapper::VideoEncoderFactoryWrapper(JNIEnv* jni,
jobject encoder_factory)
: video_codec_info_class_(jni, FindClass(jni, "org/webrtc/VideoCodecInfo")),
hash_map_class_(jni, jni->FindClass("java/util/HashMap")),
encoder_factory_(jni, encoder_factory) {
jclass encoder_factory_class = jni->GetObjectClass(*encoder_factory_);
create_encoder_method_ = jni->GetMethodID(
encoder_factory_class, "createEncoder",
"(Lorg/webrtc/VideoCodecInfo;)Lorg/webrtc/VideoEncoder;");
get_supported_codecs_method_ =
jni->GetMethodID(encoder_factory_class, "getSupportedCodecs",
"()[Lorg/webrtc/VideoCodecInfo;");
video_codec_info_constructor_ =
jni->GetMethodID(*video_codec_info_class_, "<init>",
"(ILjava/lang/String;Ljava/util/Map;)V");
payload_field_ = jni->GetFieldID(*video_codec_info_class_, "payload", "I");
name_field_ =
jni->GetFieldID(*video_codec_info_class_, "name", "Ljava/lang/String;");
params_field_ =
jni->GetFieldID(*video_codec_info_class_, "params", "Ljava/util/Map;");
hash_map_constructor_ = jni->GetMethodID(*hash_map_class_, "<init>", "()V");
put_method_ = jni->GetMethodID(
*hash_map_class_, "put",
"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
supported_codecs_ = GetSupportedCodecs(jni);
}
VideoEncoder* VideoEncoderFactoryWrapper::CreateVideoEncoder(
const cricket::VideoCodec& codec) {
JNIEnv* jni = AttachCurrentThreadIfNeeded();
ScopedLocalRefFrame local_ref_frame(jni);
jobject j_codec_info = ToJavaCodecInfo(jni, codec);
jobject encoder = jni->CallObjectMethod(*encoder_factory_,
create_encoder_method_, j_codec_info);
return encoder != nullptr ? new VideoEncoderWrapper(jni, encoder) : nullptr;
}
jobject VideoEncoderFactoryWrapper::ToJavaCodecInfo(
JNIEnv* jni,
const cricket::VideoCodec& codec) {
jobject j_params = jni->NewObject(*hash_map_class_, hash_map_constructor_);
for (auto const& param : codec.params) {
jni->CallObjectMethod(j_params, put_method_,
JavaStringFromStdString(jni, param.first),
JavaStringFromStdString(jni, param.second));
}
return jni->NewObject(*video_codec_info_class_, video_codec_info_constructor_,
codec.id, JavaStringFromStdString(jni, codec.name),
j_params);
}
std::vector<cricket::VideoCodec> VideoEncoderFactoryWrapper::GetSupportedCodecs(
JNIEnv* jni) const {
const jobjectArray j_supported_codecs = static_cast<jobjectArray>(
jni->CallObjectMethod(*encoder_factory_, get_supported_codecs_method_));
const jsize supported_codecs_count = jni->GetArrayLength(j_supported_codecs);
std::vector<cricket::VideoCodec> supported_codecs;
supported_codecs.resize(supported_codecs_count);
for (jsize i = 0; i < supported_codecs_count; i++) {
jobject j_supported_codec =
jni->GetObjectArrayElement(j_supported_codecs, i);
int payload = jni->GetIntField(j_supported_codec, payload_field_);
jobject j_params = jni->GetObjectField(j_supported_codec, params_field_);
jstring j_name = static_cast<jstring>(
jni->GetObjectField(j_supported_codec, name_field_));
supported_codecs[i] =
cricket::VideoCodec(payload, JavaToStdString(jni, j_name));
supported_codecs[i].params = JavaToStdMapStrings(jni, j_params);
}
return supported_codecs;
}
void VideoEncoderFactoryWrapper::DestroyVideoEncoder(VideoEncoder* encoder) {
delete encoder;
}
} // namespace jni
} // namespace webrtc
|
f82f144aad132a4b7cc5f2d12620e69443045fe0 | 66a18af1847c35b182a8adb7c8e258e4b3acbd0b | /QUIZ PROJECT.CPP | aec0c46aac2578207891391f5a067250838d036d | [] | no_license | jain-namit6365/MCQ-QUIZ | 37adb12d47dc18250bd3860e75cdd40ad330d8e7 | b876774be66482f1dd155185ed79e93ca334d990 | refs/heads/master | 2023-06-11T20:48:42.377763 | 2021-06-21T09:18:11 | 2021-06-21T09:18:11 | 289,492,999 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 38,350 | cpp | QUIZ PROJECT.CPP | #include<fstream>
#include<iostream>
#include<conio.h>
#include<process.h>
#include<cstdio>
#include<string.h>
#include<stdlib.h>
#include<ctime>
#include "windows.h"
void gotoxy(int x, int y)
{
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
#define LENGTH 128
#define ENTER 13
#define BACKSPACE 8
using namespace std;
const char *crpass="project"; //password for starting the program
const char *pass="project"; //password for accessing the file records
class Quiz
{ private : char name[50];
int age;
char sex;
unsigned long int phone;
int score;
char grade;
long rank;
long id;
int cor;
int wro;
int unt;
void calcgrade()
{ if(score>=35)
grade='A';
else if(score>=30)
grade='B';
else if(score>=20)
grade='C';
else if(score>=10)
grade='D';
else if(score>=0)
grade='E';
else
grade='F';
}
public : Quiz()
{ score=0;
grade='-';
strcpy(name, "NaN");
age=0;
sex='N';
phone=0;
rank=0;
id=0;
cor=0;
wro=0;
unt=0;
}
void getinfo()
{ cout<<"Enter name : ";
cin.ignore();
cin.getline(name, 50);
cout<<"Enter Age : ";
cin>>age;
cout<<"Enter Sex (M/F) : ";
cin>>sex;
cout<<"Enter Phone number : ";
cin>>phone;
}
void showinfo()
{ cout<<"Id : "<<id<<endl;
cout<<"Name : "<<name<<endl;
cout<<"Age : "<<age<<endl;
cout<<"Sex : "<<sex<<endl;
cout<<"Phone : "<<phone;
}
void result()
{ cout<<"Score :"<<score;
cout<<"\nCorrect answers :"<<cor;
cout<<"\nIncorrect answers :"<<wro;
cout<<"\nUnattempted questions :"<<unt;
calcgrade();
cout<<"\nGrade :"<<grade;
cout<<"\nRank :"<<rank;
}
void ques1()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Who was the 1st woman to score century in international T20 cricket? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Deandra Dottin \nb) Shanel Daley \nc) Stacy-Ann King \nd) Cordel Jack \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') ";
cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='a'||ans=='A')
{ cout<<"\n\nCORRECT ANSWER\n";
score+=4;
cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";
unt++;
}
else
{ cout<<"\n\nWRONG ANSWER\n";
cout<<"Correct answer is DEANDRA DOTTIN \n";
score-=1;
wro++;
}
}
void ques2()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Which of these is a make of trucks of Czech origin, used by the |\n";
cout<<"| Indian army? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Mercedes Benz \nb) Tatra \nc) Sikorsky \nd) MiG \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='b'||ans=='B')
{ cout<<"\n\nCORRECT ANSWER\n";
score+=4;
cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";
unt++;
}
else
{ cout<<"\n\nWRONG ANSWER\n";
cout<<"Correct answer is TATRA\n";
score-=1;
wro++;
}
}
void ques3()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Gyaneshwari, Lichchavi, Gorakdham and Sarayu are all names of what? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Saree Types \nb) Rivers \nc) Express Trains \nd) Buddhist Monasteries \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='c'||ans=='C')
{ cout<<"\n\nCORRECT ANSWER\n";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER\n";
cout<<"Correct answer is EXPRESS TRAINS \n";
score-=1;wro++;
}
}
void ques4()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Which of these films has a tag line 'Every Child is Special'? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Paa \nb) Koi Mil Gaya \nc) Taare Zameen Par \nd) Paathshaala \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='c'||ans=='C')
{ cout<<"\n\nCORRECT ANSWER\n";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER\n";
cout<<"Correct answer is TAARE ZAMEEN PAR \n";
score-=1;wro++;
}
}
void ques5()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Which temple is believed to have first built in gold, then silver, |\n";
cout<<"| then wood and finally stone? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Somnath Temple \nb) Kashi Vishwanath \nc) Khajuraho Temple \nd) Mahakaal Temple \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='a'||ans=='A')
{ cout<<"\n\nCORRECT ANSWER\n";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER\n";
cout<<"Correct answer is SOMNATH TEMPLE \n";
score-=1;wro++;
}
}
void ques6()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Which among the following never became President of Pakistan? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Mohammad Ali Zinnah \nb) Iskander Mirza \nc) Asif Ali Zardari \nd) Zulfikar Ali Bhutto \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='a'||ans=='A')
{ cout<<"\n\nCORRECT ANSWER\n";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER\n";
cout<<"Correct answer is MOHAMMAD ALI ZINNAH \n";
score-=1;wro++;
}
}
void ques7()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Whose birthday is celebrated as 'Engineers' Day' in India? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) A P J Abdul Kalam \nb) John C. Gammon \nc) M Visvesvarayya \nd) Soren Krisitian Toubro \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='c'||ans=='C')
{ cout<<"\n\nCORRECT ANSWER\n";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER\n";
cout<<"Correct answer is M VISVESVARAYYA \n";
score-=1;wro++;
}
}
void ques8()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Which is the largest passenger airliner in the world? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Boeing 767 \nb) Airbus A380 \nc) Ilyushin IL-96 \nd) Boeing 787 \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='b'||ans=='B')
{ cout<<"\n\nCORRECT ANSWER\n";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER\n";
cout<<"Correct answer is AIRBUS A380 \n";
score-=1;wro++;
}
}
void ques9()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Which of these women has not partnered Leander Paes winning Mixed |\n";
cout<<"| Doubles titles at Grand Slam tennis? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Martina Navratilova \nb) Cara Black \nc) Lisa Raymond \nd) Rika Hiraki \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='d')
{ cout<<"\n\nCORRECT ANSWER\n";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER\n";
cout<<"Correct answer is RIKA HIRAKI \n";
score-=1;wro++;
}
}
void ques10()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.To whom did Jawaharlal Nehru dedicate his book 'The Discovery of |\n";
cout<<"| India'? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Mill workers of Ahmedabad \nb) Prisoners of Ahmed Nagar Jail \nc) Family in Alahabad \nd) People of India \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='b'||ans=='B')
{ cout<<"\n\nCORRECT ANSWER\n";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER\n";
cout<<"Correct answer is PRISNORS OF AHMED NAGAR JAIL \n";
score-=1;wro++;
}
}
void ques11()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.In which film does Rajesh Khanna tell his heroine, 'Pushpa, I hate |\n";
cout<<"| tears'? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Aradhana \nb) Kati Patang \nc) Amar Prem \nd) Daag \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='c'||ans=='C')
{ cout<<"\n\nCORRECT ANSWER";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER\n";
cout<<"Correct answer is AMAR PREM \n";
score-=1;wro++;
}
}
void ques12()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Which year in the western calender corresponds to the beginning of |\n";
cout<<"| the Saka Era, on which the Indian National Calender based? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) 78 B.C. \nb) A.D. 78 \nc) A.D. 1757 \nd) A.D. 1947 \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='b'||ans=='B')
{ cout<<"\n\nCORRECT ANSWER";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER \n";
cout<<"Correct answer is A.D. 78 \n";
score-=1;wro++;
}
}
void ques13()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.On being produced before magistrate, who gave his name as 'Azad', |\n";
cout<<"| father's name as 'Swatantra' and residence as 'Jail'? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Ram Prasad Bismil \nb) Chandrashekhar Tiwari \nc) Rajendra Lahiri \nd) Ashfaqullah Khan \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='b'||ans=='B')
{ cout<<"\n\nCORRECT ANSWER";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
unt++;
}
else
{ cout<<"\n\nWRONG ANSWER \n";
cout<<"Correct answer is CHANDRASHEKHAR TIWARI \n";
score-=1;wro++;
}
}
void ques14()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.In mobile phones what are monophonic and polyphonic? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Dial tone \nb) Display screen \nc) Text messages \nd) Ring tone \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='d'||ans=='D')
{ cout<<"\n\nCORRECT ANSWER";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER \n";
cout<<"Correct answer is RING TONE \n";
score-=1;wro++;
}
}
void ques15()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Who began his speech with 'Sisters and Brothers of America' at the |\n";
cout<<"| world parliament of religions at Chicago in 11 sept 1893? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Ramkrishna Paramhansa \nb) Dayanand Saraswati \nc) Swami Vivekananda \nd) Rabindranath Tagore \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='c'||ans=='C')
{ cout<<"\n\nCORRECT ANSWER";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER \n";
cout<<"Correct answer is SWAMI VIVEKANANDA \n";
score-=1;wro++;
}
}
void ques16()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.What was the world's first clone animal? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Chimpanzee \nb) Sheep \nc) Rabbit \nd) Goat \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='b'||ans=='B')
{ cout<<"\n\nCORRECT ANSWER";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER \n";
cout<<"Correct answer is SHEEP \n";
score-=1;wro++;
}
}
void ques17()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Which of the following Prime Ministers was not born in what is now |\n";
cout<<"| Pakistan? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Gulzarilal Nanda \nb) IK Gujral \nc) Manmohan Singh \nd) Moraji Desai \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='d'||ans=='D')
{ cout<<"\n\nCORRECT ANSWER";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER \n";
cout<<"Correct answer is MORAJI DESAI \n";
score-=1;wro++;
}
}
void ques18()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Which of these Chief Minister of an Indian State is an IIT Graduate? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Manohar Parrikar \nb) Okram Ibobi Singh \nc) Kiran Kumar Reddy \nd) Omar Abdullah \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='a'||ans=='A')
{ cout<<"\n\nCORRECT ANSWER";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER \n";
cout<<"Correct answer is MANOHAR PARRIKAR \n";
score-=1;wro++;
}
}
void ques19()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Which of these buildings in Rajasthan was built to provide |\n";
cout<<"| employment to people during a period of famine? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Amber Fort \nb) Hawa Mahal \nc) Mehrangarh Fort \nd) Umaid Bhawan palace \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='d'||ans=='D')
{ cout<<"\n\nCORRECT ANSWER";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER \n";
cout<<"Correct answer is UMAID BHAWAN PALACE \n";
score-=1;wro++;
}
}
void ques20()
{ char ans;
cout<<"|------------------------------------------------------------------------|\n";
cout<<"| Q.Douglas Engelbert, who passed away in 2013, is credited as the |\n";
cout<<"| inventor of which of these products ? |\n";
cout<<"|------------------------------------------------------------------------|\n\n";
cout<<"a) Mobile Phone \nb) Computer Mouse \nc) Bluetooth Mouse \nd) Digital camera \n\n";
cout<<"(-> To leave the ques unattempted press 'x/X'\n ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='b'||ans=='B')
{ cout<<"\n\nCORRECT ANSWER";
score+=4; cor++;
}
else if(ans=='L')
{exit(0);}
else if(ans=='x'|| ans=='X')
{cout<<"\n\nQUESTION UNATTEMPTED\n";unt++;
}
else
{ cout<<"\n\nWRONG ANSWER \n";
cout<<"Correct answer is COMPUTER MOUSE \n";
score-=1;wro++;
}
}
void q1()
{ char ans;
cout<<"|-----------------------------------------------|\n";
cout<<"| Q. What is T in ATM, with respect to banking? |\n";
cout<<"|-----------------------------------------------|\n\n";
cout<<"(a) Transaction\n(b) Telebanking\n(c) Teller\n(d) Teleporting\n\n";
cout<<"(->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='c')
{ cout<<"\n\n!!! CONGRATULATIONS !!! Correct Answer";
cout<<"\n\nNow you can participate in the Quiz";
}
else if(ans=='L')
{exit(0);}
else
{ cout<<"\n\n!!! SORRY !!! Wrong Answer";
cout<<"\n\nTry again next time";
getch(); exit(0);
}
}
void q2()
{ char ans;
cout<<"|------------------------------------------------|\n";
cout<<"| Q. Which of these constitutional positions has |\n";
cout<<"| never been held by a woman in India? |\n";
cout<<"|------------------------------------------------|\n\n";
cout<<"(a) President\n(b) Vice President\n(c) Chief minister\n(d) State Governor\n\n";
cout<<"( ->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='b')
{ cout<<"\n\n!!! CONGRATULATIONS !!! Correct Answer";
cout<<"\n\nNow you can participate in the Quiz";
}
else if(ans=='L')
{exit(0);}
else
{ cout<<"\n\n!!! SORRY !!! Wrong Answer";
cout<<"\n\nTry again next time";
getch(); exit(0);
}
}
void q3()
{ char ans;
cout<<"|------------------------------------------------|\n";
cout<<"| Q. Which Indian company acquired the British |\n";
cout<<"| car-maker Jaguar Land Rover in 2008? |\n";
cout<<"|------------------------------------------------|\n\n";
cout<<"(a) Mahindra and Mahindra\n(b) Maruti Udyog\n(c) Ashok Leyland\n(d) Tata Motors\n\n";
cout<<"(->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='d')
{ cout<<"\n\n!!! CONGRATULATIONS !!! Correct Answer";
cout<<"\n\nNow you can participate in the Quiz";
}
else if(ans=='L')
{exit(0);}
else
{ cout<<"\n\n!!! SORRY !!! Wrong Answer";
cout<<"\n\nTry again next time";
getch(); exit(0);
}
}
void q4()
{ char ans;
cout<<"|------------------------------------------------|\n";
cout<<"| Q. Which of these states share its border with |\n";
cout<<"| only one other Indian State? |\n";
cout<<"|------------------------------------------------|\n\n";
cout<<"(a) Sikkim\n(b) Jammu and Kashmir\n(c) Tripura\n(d) Himachal Pradesh\n\n";
cout<<"(->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='a')
{ cout<<"\n\n!!! CONGRATULATIONS !!! Correct Answer";
cout<<"\n\nNow you can participate in the Quiz";
}
else if(ans=='L')
{exit(0);}
else
{ cout<<"\n\n!!! SORRY !!! Wrong Answer";
cout<<"\n\nTry again next time";
getch(); exit(0);
}
}
void q5()
{ char ans;
cout<<"|------------------------------------------------|\n";
cout<<"| Q. What right is given to children through the |\n";
cout<<"| RTE Act passed by the Government? |\n";
cout<<"|------------------------------------------------|\n\n";
cout<<"(a) Education\n(b) Internet\n(c) Entertainment\n(d) Employment\n\n";
cout<<"(->To leave the quiz,press 'L') "; cout<<"\nEnter your answer : ";
cin>>ans;
if(ans=='a')
{ cout<<"\n\n!!! CONGRATULATIONS !!! Correct Answer";
cout<<"\n\nNow you can participate in the Quiz";
}
else if(ans=='L')
{exit(0);}
else
{ cout<<"\n\n!!! SORRY !!! Wrong Answer";
cout<<"\n\nTry again next time";
getch(); exit(0);
}
}
void getrank(long x)
{ rank=x;
}
long retrank()
{ return rank;
}
int retscore()
{ return score;
}
void getid(long x)
{ id=x;
}
long retid()
{ return id;
}
};
Quiz parresult(Quiz q) //showing the result to the user
{ Quiz q1;
fstream abc;
abc.open("Information.dat",ios::in|ios::binary);
while(!abc.eof())
{ abc.read((char*)&q1,sizeof(q1));
if(abc.eof())
break;
if(q.retid()==q1.retid())
{ q1.showinfo();
cout<<endl;
q1.result();
}
}
abc.close();
}
Quiz storeinfo(Quiz q) //storing result in the sorted file
{ Quiz q1;
fstream abc,def;
abc.open("Information.dat",ios::in|ios::binary);
def.open("Temp.dat",ios::app|ios::binary);
if(!abc)
{ cout<<"File not present";
getch();
exit(0);
}
char last='y';
int i=1,j=0;
long r=0;
while(!abc.eof())
{ abc.read((char*)&q1,sizeof(q1));
if(abc.eof())
break;
q.getrank(i);
i++;
if(q.retscore()>=q1.retscore())
{ if(j==1)
{ r=q1.retrank()+1;
q1.getrank(r);
def.write((char*)&q1,sizeof(q1));
}
else
{ def.write((char*)&q,sizeof(q));
last='n';
j=1;
if(q1.retrank()!=0)
{ r=q1.retrank()+1;
q1.getrank(r);
def.write((char*)&q1,sizeof(q1));
}
}
}
else
def.write((char*)&q1,sizeof(q1));
}
if(last=='y')
{ q.getrank(i);
def.write((char*)&q,sizeof(q));
}
abc.close();
def.close();
remove("Information.dat");
rename("Temp.dat","Information.dat");
}
Quiz showresult(Quiz q) //showing all results to the user
{
//char *password = getpass("Enter Password : ");
//OR
cout<<"Enter Password : ";
char password[LENGTH];
char ch;
int pos=0;
while(true)
{
ch=getch();
if(pos>=LENGTH) {cout<<'\a'; continue;} //beep if password is too long
if(ch==ENTER) break; //User have pressed ENTER
else if(ch==BACKSPACE) //BACKSPACE was pressed
{
cout <<"\b \b";
password[--pos]='\0';
}
else// A..Z a...z
{
cout <<"*";
password[pos++]=ch;
password[pos]='\0';
}
if(pos<=0) pos=0;
}
if(strcmp(password,crpass)==0)
{ fstream abc;
int i=0,j=0;
system("cls");
abc.open("Information.dat",ios::in|ios::binary);
if(!abc)
{ cout<<"File not Present";
getch();
exit(0);
}
while(!abc.eof())
{ abc.read((char*)&q,sizeof(q));
if(abc.eof())
break;
i++;
j=1;
q.showinfo();
cout<<"\n";
q.result();
cout<<"\n\n";
if(i==2)
{ cout<<"Press any key to view more ";
getch();
i=0;
system("cls");
}
}
if(j==0)
cout<<"No Record Found";
abc.close();
}
else
{ cout<<"Incorrect Password !!!";
getch();
}
}
Quiz getinfo(Quiz q) //searching and displaying info of specific participant
{
//char *password=getpass("Enter Password : ");
//OR
cout<<"Enter Password : ";
char password[LENGTH];
char ch;
int pos=0;
while(true)
{
ch=getch();
if(pos>=LENGTH) {cout<<'\a'; continue;} // beep if password is too long
if(ch==ENTER) break; // User have pressed ENTER
else if(ch==BACKSPACE) // BACKSPACE was pressed
{
cout <<"\b \b";
password[--pos]='\0';
}
else // A..Z a...z
{
cout <<"*";
password[pos++]=ch;
password[pos]='\0';
}
if(pos<=0) pos=0;
}
if(strcmp(password,crpass)==0)
{
system("cls");
fstream abc;
abc.open("Information.dat",ios::in|ios::binary);
if(!abc)
{ cout<<"File not present";
getch();
exit(0);
}
long ph;
int c=0;
cout<<"Enter Id of participant to be searched : ";
cin>>ph;
while(!abc.eof())
{ abc.read((char*)&q,sizeof(q));
if(abc.eof())
break;
if(q.retid()==ph)
{ q.showinfo();
cout<<endl;
q.result();
c=1;
}
}
if(c==0)
cout<<"Record not present";
abc.close();
}
else
{ cout<<"Incorrect Password !!!";
getch();
}
}
Quiz deleteinfo(Quiz q) //deleting info of specific participant
{
//char*password=getpass("Enter Password : ");
//OR
cout<<"Enter Password : ";
char password[LENGTH];
char ch;
int pos=0;
while(true)
{
ch=getch();
if(pos>=LENGTH) {cout<<'\a'; continue;} // beep if password is too long
if(ch==ENTER) break; // User have pressed ENTER
else if(ch==BACKSPACE) // BACKSPACE was pressed
{
cout <<"\b \b";
password[--pos]='\0';
}
else// A..Z a...z
{
cout <<"*";
password[pos++]=ch;
password[pos]='\0';
}
if(pos<=0) pos=0;
}
if(strcmp(password,crpass)==0)
{
system("cls");
fstream abc,def;
abc.open("Information.dat",ios::in|ios::binary);
def.open("Temp.dat",ios::app|ios::binary);
if(!abc)
{ cout<<"File not present";
getch();
exit(0);
}
long ph;
char confirm='n';
int c=0;
long r=0,i=0;
cout<<"Enter id of participant whose information is to be deleted : ";
cin>>ph;
while(!abc.eof())
{ abc.read((char*)&q,sizeof(q));
if(abc.eof())
break;
if(q.retid()==ph)
{ q.showinfo();
cout<<endl;
q.result();
c=1;
cout<<"\n\nAre you sure you want to delete this record? (y/n) : ";
cin>>confirm;
if(confirm=='y'||confirm=='Y')
cout<<"Record Deleted";
else
def.write((char*)&q,sizeof(q));
}
else
{ if(confirm=='y'||confirm=='Y')
{ r=q.retrank()-1;
q.getrank(r);
}
def.write((char*)&q,sizeof(q));
}
}
if(c==0)
cout<<"!!!!! Record not Found !!!!!";
abc.close();
def.close();
remove("Information.dat");
rename("Temp.dat","Information.dat");
}
else
{ cout<<"Incorrect Password !!!";
getch();
}
}
Quiz getid(Quiz q)
{ Quiz q1;
fstream abc;
int i=0;
long Id=0;
abc.open("Information.dat",ios::in|ios::binary);
while(!abc.eof())
{ abc.read((char*)&q1,sizeof(q1));
if(abc.eof())
break;
i=1;
if(Id<=q1.retid())
Id=q1.retid()+1;
q.getid(Id);
}
if(i==0)
{ Id=1;
q.getid(Id);
}
Id=q.retid();
cout<<"Your id is "<<Id;
return q;
}
int main()
{
system("cls");
srand(time(0));
gotoxy(32,1);cout<<"PROGRAM OF QUIZ \n\n";
//char*password=getpass("Enter Password : ");
//OR
cout<<"Enter Password : ";
char password[LENGTH];
char ch;
int pos=0;
while(true)
{
ch=getch();
if(pos>=LENGTH) {cout<<'\a'; continue;} // beep if password is too long
if(ch==ENTER) break; // User have pressed ENTER
else if(ch==BACKSPACE) // BACKSPACE was pressed
{
cout <<"\b \b";
password[--pos]='\0';
}
else// A..Z a...z
{
cout <<"*";
password[pos++]=ch;
password[pos]='\0';
}
if(pos<=0) pos=0;
}
if(strcmp(password,pass)==0)
{
system("cls");
char c;
do{
Quiz q;
int ch=0,a=0,k[10],i=0,j=0;
fstream abc;
abc.open("Information.dat",ios::app|ios::binary);
abc.close();
for(i=0;i<10;i++)
{ k[i]=0; }
gotoxy(32,4);
cout<<"CHOICES\n\n ";
cout<<"\n1. Play the Quiz";
cout<<"\n2. Display the information of all Participants";
cout<<"\n3. Display the information of a specific participant with the help of his/ ";
cout<<"\n her Id";
cout<<"\n4. Delete information of a specific participant with the help of his/her Id";
cout<<"\n5. Close the Program";
cout<<"\n\nEnter choice : "; //taking choice from the user
cin>>ch;
system("cls");
switch(ch)
{ case 1: cout<<"******************************************************************************";
cout<<"\n******************************************************************************";
cout<<"\n**||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||**";
cout<<"\n**|| ------------------------------ ||**";
cout<<"\n**|| <<<<< WELCOME TO THE GRAND QUIZ SHOW >>>>> ||**";
cout<<"\n**|| ------------------------------ ||**";
cout<<"\n**||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||**";
cout<<"\n******************************************************************************";
cout<<"\n******************************************************************************";
cout<<"\n\n\n";
cout<<"Comply by the following rules to play this Quiz : ";
cout<<"\n@ You will first have to answer a qualification question to participate in the Quiz.";
cout<<"\n@ There would be 10 questions in the Quiz.";
cout<<"\n@ Each correct answer will get you 4 marks.";
cout<<"\n@ For every wrong answer 1 mark will be deducted.";
cout<<"\n@ For every unattemted question 0 marks will be awarded.";
cout<<"\n@ Attempt the questions answering with 'a','b','c','d'(or 'A','B','C','D').";
cout<<"\n@ Leave the question unattempted by answering with 'x' (or 'X').";
cout<<"\n\nPress any key to continue";
getch();
system("cls");
gotoxy(32,1);
cout<<"Qualification Question\n";
cout<<"Your qualification question is :-\n\n";
a = rand() % 5;
switch(a) //calling functions randomly
{ case 0: q.q1(); break;
case 1: q.q2(); break;
case 2: q.q3(); break;
case 3: q.q4(); break;
case 4: q.q5();
}
cout<<"\n\nPress any key to continue";
getch();
system("cls");
gotoxy(37,1);
cout<<"DETAILS\n";
cout<<"Enter your information : \n";
q.getinfo();
q=getid(q);
cout<<"\n\nPress any key to continue";
getch();
system("cls");
for(i=0;i<10;i++) //loop to display 10 questions
{ abc: //conditions so that no 2 questions gets repeated
a=rand() % 20 +1;
for(j=0;j<10;j++)
{ if(a==k[j])
goto abc;
}
k[i]=a;
switch(a) //calling functions randomly
{ case 1: q.ques1(); break;
case 2: q.ques2(); break;
case 3: q.ques3(); break;
case 4: q.ques4(); break;
case 5: q.ques5(); break;
case 6: q.ques6(); break;
case 7: q.ques7(); break;
case 8: q.ques8(); break;
case 9: q.ques9(); break;
case 10: q.ques10(); break;
case 11: q.ques11(); break;
case 12: q.ques12(); break;
case 13: q.ques13(); break;
case 14: q.ques14(); break;
case 15: q.ques15(); break;
case 16: q.ques16(); break;
case 17: q.ques17(); break;
case 18: q.ques18(); break;
case 19: q.ques19(); break;
case 20: q.ques20();
}
cout<<"\n\nPress any key to continue";
getch();
system("cls");
}
storeinfo(q);
parresult(q);
break;
case 2: showresult(q);
cout<<"All records shown";
break;
case 3: getinfo(q);
break;
case 4: deleteinfo(q);
break;
case 5: exit(0);
break;
default: cout<<"!!!!! WRONG CHOICE !!!!!";
}
cout<<"\n\nPress any key to continue";
getch();
system("cls");
cout<<"\nDo you want to do more operations (Y/N) : "; //asking user to continue using the program
cin>>c;
cout<<endl;
}while(c=='y'||c=='Y');
}
else
cout<<"\n\nIncorrect Password";
cout<<"\n\nProject made by Namit Jain";
getch();
}
|
a50019f2b69286a03d86828b3aa9e8a94bf2ab4e | a986c1dbdd71e2a3e3a02e457fc01e2211992994 | /HF/HF/mainX.cpp | 4f44eb970564d6464c1b2803586ccbc6238a8271 | [] | no_license | soixantecircuits/happy-flight | 1836c079f95cb4ff633ce1a1537bdf243df3161f | 3465bdf22d5e1b0a134192ac8c30ed62d31175ac | refs/heads/master | 2021-01-21T06:53:26.274763 | 2011-11-09T09:42:36 | 2011-11-09T09:42:36 | 2,435,864 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 183 | cpp | mainX.cpp |
#include "game.h"
#include "SDL.h"
using namespace std;
int main(int argc, char *argv[])
{
SDL_Init(SDL_INIT_VIDEO);
srand(0);
Game game;
game.Run();
SDL_Quit();
return 0;
}
|
7249c2c945cae75a73a913dae925c76ce7c8a751 | c1ea86f1c551ac343e2d3a1e5d7e96c5d92d1dd5 | /07/Thread.cpp | 6c6b98ed792f35fa2063d3a7f053351b686f17ae | [] | no_license | itherunder/tiny-muduo | 93e0f490c8b73d7306fac4037716e3b5f32d0e5f | fd08bfe068c9a5fe612e1009160e61d1ead70453 | refs/heads/main | 2023-07-10T10:29:47.265407 | 2021-08-25T07:18:49 | 2021-08-25T07:18:49 | 395,884,378 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 732 | cpp | Thread.cpp | #include "Thread.h"
#include <iostream>
using namespace std;
//初始化的顺序一般需要按照类中定义的顺序
Thread::Thread(const ThreadFunc& func) : func_(func), autoDelete_(false) {
cout << "Thread ..." << endl;
}
Thread::~Thread() {
cout << "~Thread ..." << endl;
}
void Thread::Start() {
pthread_create(&threadId_, nullptr, ThreadRoutine, this);
}
void Thread::Join() {
pthread_join(threadId_, nullptr);
}
void Thread::Run() {
func_();
}
void* Thread::ThreadRoutine(void* argv) {
Thread* thread = (Thread*)argv;
thread->Run();
if (thread->autoDelete_)
delete thread;
return nullptr;
}
void Thread::SetAutoDelete(bool autoDelete) {
autoDelete_ = autoDelete;
}
|
22acbfc22b30aac159e35781668fb42b52919c15 | 19942c90af650e6f781c2048c069c274f4b2511c | /Nikita_prog/Read.cpp | 12ce2671d1d0ee95f95319789769ce60510d383c | [] | no_license | tarstars/coeff_tune | 48a9c0bca859e1bb1c3568675e98e519262eb66a | f9f2f6861be476e4d0eac45ce2ded9c8767b1db5 | refs/heads/master | 2021-01-17T06:35:25.030647 | 2018-03-29T21:48:25 | 2018-03-29T21:48:25 | 4,085,781 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,616 | cpp | Read.cpp | #include "Read.h"
#include<sstream>
#include<set>
#include<vector>
void RawData::Hello(){printf("Hellow RawData\n");}
void RawData::read(char *path,int NV)
{
// std::ifstream ist(path);
FILE * file;
file=fopen(path,"r");
if (!file)
printf("Bad stream\n");
int sc=0,lind=0,off=1;
char ival=' ',pval=' ';
std::stringstream text(std::stringstream::in | std::stringstream::out);
std::string perms ("0123456789. \r\t\n");
std::set<char> permset(perms.begin(), perms.end());
//std::vector<double> *row0=new std::vector<double>, *row1=new std::vector<double>;
double val=0;
int flag=3,columns=0;
if (phi.size()!=0)
{phi.clear();theta.clear();v.clear();}
while(!feof(file))
{
lind++;
pval=ival;
sc=fscanf(file,"%c",&ival);
if (permset.find(pval)!=permset.end())
if ((ival=='0')||((ival<='9')&&(ival>='1'))||(ival=='.'))
if (text.eof()) {text.clear();
text<<ival;}
else
text<<ival;
else if ((ival==' ')||(ival=='\t')) //||(ival=='\r'))
if (text.eof())
{}
else if (flag==0)
{text>>val; printf("%lf, ",val);
v.push_back(val);
// printf("%d, %d, %d\n",(v.size()-1),(phi.size()-1),(v.size()-1)%(phi.size()-1)+1);
addData(theta.back(),phi[(v.size()-1)%(phi.size()-off)+off],val,NV);
flag=0;}
else if(flag==1)
{text>>val; printf("|%lf|, ",val);
theta.push_back(val);
flag=0;}
else if(flag==3)
{text>>val; printf("**%lf, ",val);
phi.push_back(val);columns++;
flag=3;}
else printf("Whatthefuc????");
else if (ival=='\n')
{
// printf("\n!n, flag=%d\n",flag);
if (flag==3)
{
if (phi.size()>5)
{
if (!text.eof())
{
flag=1;
text>>val; printf("**%lf!!\n",val);
phi.push_back(val);columns++;
}
else
{
flag=1;
printf("!!!\n");
}
}
else
{
// text>>val; printf("**%lf!!\n",val);
phi.clear();//printf("\nclear, %d\n",phi.size());
}
}
else
{
if (!text.eof())
{
flag=1;
text>>val; printf("%lf!\n",val);
v.push_back(val);
// printf("%d, %d, %d %lf\n",(v.size()-1),(phi.size()-1),(v.size()-1)%(phi.size()-1)+1,phi[13]);
addData(theta.back(),phi[(v.size()-1)%(phi.size()-off)+off],val,NV);
}
else
{
flag=1;
printf("!!!\n");
}
}
}
else
{printf("\nFuuu=%c(%d)! %d\n",ival,ival,lind);if(ival=='\r')printf("!r");}
else
{printf("fuu! %c -- %c(%d) %d\n",pval,ival,ival,lind);if (text.eof())printf("EOFu!");}
}
// while(ist>>ival)
/*
while(!feof(file))
{
lind++;
pval=ival;
sc=fscanf(file,"%c",&ival);
// printf("%c,%c",ival,pval);
// printf("=%d ",int(ival));
if (permset.find(ival)!=permset.end())
if (permset.find(pval)!=permset.end())
if (pval!='\n')
text<<ival;
else
while(text>>val)
{
printf("%lf, ",val);
row.push_back(val);
}
else
printf("fuu! %c -- %d\n",pval,lind);
else
printf("Fuuu=%c! %d\n",ival,lind);
// printf("%lf",inum);
// printf("\n%d\n",sc);
// printf("%lf",inum);
// printf("\n%d\n",sc);
}
*/
printf("----------------\nstring left\n%s\n---------------\n\n",text.str().c_str());
/*
double val;
while(text>>val)
{
printf("%lf\n",val);
}
*/
fclose(file);
}
void RawData::addData(double theta,double phi,double val,int nv)
{
vec3 vs;
Direction di(theta,phi);
// printf("[%lf, %lf]: %lf (%d)\n",theta,phi,val,nv);
// printf("[%lf, %lf]: %lf (%d) -> %lf\n",di.theta,di.phi,val,nv,vs[nv]);
vs=data[di];
// vs.show();
vs[nv]=val;
data[di]=vs;
// vs.show();
/*
printf("[%lf, %lf]: %lf, %lf, %lf\n",di.theta,
di.phi,
data[di][0],
data[di][1],
data[di][2]);
*/
}
void RawData::show(char *c)
{
printf("______________________________\n");
printf(c);
std::map < Direction, vec3 >::iterator pdata;
pdata=data.begin();
unsigned int i=0;
while(i<data.size())
{
printf("[%lf, %lf]: %lf, %lf, %lf\n",pdata->first.theta,pdata->first.phi,(*pdata).second[0],(*pdata).second[1],(*pdata).second[2]);
++pdata;printf("aga\n");++i;
}
}
void RawData::read(char *path1, char *path2, char *path3)
{
read(path1,0);
read(path2,1);
read(path3,2);
}
|
b01d91d34b2537b52ed7df59902ce6d19dc30566 | 448cfba87a8610f835c11052ea08929b6db38a92 | /Solutions/offer64.cpp | ed644c3d8405a8d7348379576e870cadb4d9fe10 | [] | no_license | Mrtriste/Leetcode | b9f34152c2f3c90d977e4fef81cec54fea60ffb7 | 155730dff0e8f48009cd9e6792adddd66c2de1b4 | refs/heads/master | 2021-01-13T02:58:47.527065 | 2020-10-17T03:30:11 | 2020-10-17T03:30:11 | 258,604,224 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 398 | cpp | offer64.cpp | #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <cmath>
#include <memory.h>
#include <functional>
using namespace std;
int sumNums(int n) {
n&&n+=sumNums(n-1);
return n;
}
int main() {
return 0;
}
|
7909afa4eac8400041605e9bc59db3cf5f7b5f16 | 125ae0adb562478b184bbb35d40f2c43b335415c | /FusionControl/Clients/FusionLink/tFusionLinkClient.cpp | 6f1c9686c94620e246542c202d1f1366989ce4d9 | [] | no_license | dulton/53_hero | ff49ce6096c379931d7649b654c5fa76de4630de | 48057fe05e75f57b500a395e6ff8ff9c06da6895 | refs/heads/master | 2020-02-25T04:19:18.632727 | 2016-05-20T03:44:44 | 2016-05-20T03:44:44 | 62,197,327 | 3 | 2 | null | 2016-06-29T05:11:41 | 2016-06-29T05:11:38 | null | WINDOWS-1252 | C++ | false | false | 126,634 | cpp | tFusionLinkClient.cpp | /*****************************************************/
// Copyright © 2007-2013 Navico
// Confidential and proprietary. All rights reserved.
/*****************************************************/
/*
* See header file for description of methods/variables
*
* NOTES
* - All FusionLink strings are in UTF8
*/
#include "tFusionLinkClient.h"
#include "tFusionLinkAudioZone.h"
#include "FusionControl/Transports/tFusionData.h"
#include "FusionControl/Transports/tFusionLinkNmea2kTransport.h"
#include <DigitalData/NDP2k/tNDP2k.h>
#include <MathLib/Rand.h>
#include <Core/Connect.h>
#include <Core/Debug.h>
// Qt headers
#pragma warning(push, 1)
#include <QCoreApplication>
#include <QMetaType>
#pragma warning(pop)
//! How long to wait after entering state InitStateProbingPowerState before retrying.
//! 1200 chosen because it is a bit longer than the 1 second, the time that the server
//! waits before responding to another fapiGetState (e.g. in case of another client
//! is initializing at same time).
static const int ProbingPowerStateTimeoutInterval = 1200;
//! How long to wait after entering state InitStatePoweringOn before retrying.
//! 3000 chosen based on being a bit longer than time it takes MS-700 to boot.
static const int PoweringOnTimeoutInterval = 3000;
//! How long to wait after entering state InitStateGettingState before retrying.
//! This probably can be same as CommunicationTimeoutInterval?
static const int GettingStateTimeoutInterval = 5000;
//! How long to wait without messages from server before assuming connection is
//! lost and restarting initialization.
//! 5 seconds taken from section "Disconnections from the server / head-unit" of
//! "FUSION-Link Ethernet Transport Specification.docx"
static const int CommunicationTimeoutInterval = 5000;
//! Minimum time between zone setting commands (like changing volume level).
static const int MinZoneSettingInterval = 50;
//! Maximum time between zone setting commands (like changing volume level)
//! if a zone setting needs to be made.
static const int MaxZoneSettingInterval = 500;
//! Table of text from FusionLink menu items that need to be translated.
//! Refer to chapter "Translations" of section "Menu Handling" of
//! document "FUSION-Link Specification.docx" in Sharepoint.
//! Note: m_MenuText is not used directly, but needs to be here for the
//! translation process to know what strings need to be translatable.
//! Search for "Fusion Link menu" to see where the translation is used.
const char* tFusionLinkClient::m_MenuText[] =
{
QT_TRANSLATE_NOOP( "Fusion Link menu", "Playlists" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Artists" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Albums" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Songs" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Podcasts" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Genres" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Composers" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Audiobooks" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Videos" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "All Artists" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "All Albums" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "All Tracks" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Nested Playlists" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Genius Mixes" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "iTunes U" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Preset" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Add Preset" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Remove Preset" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Remove All" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Parental" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Unlock" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Lock/Unlock" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Clear All Locked" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Change PIN" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Remove Device" ),
QT_TRANSLATE_NOOP( "Fusion Link menu", "Discoverable" ),
};
#define NO_SUB_AVAILABLE 0xFF // if no sub is available to set the level
//-----------------------------------------------------------------------------
//! ctor
//-----------------------------------------------------------------------------
tFusionLinkClient::tFusionLinkClient( tNDP2k& ndp2k, const tFusionServerId& serverId )
: tFusionClient( serverId )
, m_rNDP2k( ndp2k )
, m_InitState( eInitStateStart )
, m_pInitStateTimer( 0 )
, m_PowerState( ePS_Invalid )
, m_Mute( eS_Invalid )
, m_SourceId( static_cast<quint8>( cFusionInvalidSourceId ) )
, m_SourcesCount( 0 )
, m_Sources()
, m_MediaTrackInfo()
, m_DvdInfo( )
, m_MenuLockSeed( 0 )
, m_MenuLockId( 0 )
, m_HasZone2Linked( false )
, m_Zone2Linked( false )
, m_ZoneCount( 0 )
, m_hasGlobalZone( false )
, m_AudioZones()
, m_pNmea2kTransport( 0 )
, m_State( eFLS_Disconnected )
, m_TunerRegion( eTR_Unknown )
, m_ScanOn(eS_Invalid)
, m_AMPresets( cMaxFavorites )
, m_FMPresets( cMaxFavorites )
, m_VHFPresets( cMaxFavorites )
, m_UsbRepeatMode( eRM_RepeatOff )
, m_UsbShuffleMode( eSM_ShuffleOff )
, m_IpodRepeatMode( eRM_RepeatOff )
, m_IpodShuffleMode( eSM_ShuffleOff )
, m_MtpRepeatMode( eRM_RepeatOff )
, m_MtpShuffleMode( eSM_ShuffleOff )
, m_AlphaSearchThreshold( eFLAST_Off )
, m_IpodSubtitles( eFLIS_Off )
, m_Telemute( eFLTM_Mute )
, m_IpodAlbumArtwork( eFLIAA_Enable )
, m_IpodVideoSignal( eFLIVS_NTSC )
, m_IpodMonitorAspect( eFLIMA_4_3 )
, m_AuxNameIndex( eFLANI_Aux )
, m_AmEnabled( eFLAE_Disable )
, m_VhfEnabled( eFLVE_Disable )
, m_InternalAmpsEnabled( eFLIAE_Disabled )
, m_AccessorySource( eFLAS_Sirius )
, m_UpdatingAllSources( false )
, m_SteppingBackToRoot( false )
{
qRegisterMetaType< tFusionData >( "tFusionData" );
// FusionLink supports up to 4 zones plus global zone.
// Create them now with appropriate default names.
// Only zones 2,3,4 can be disabled.
m_AudioZones.append(new tFusionLinkAudioZone(*this, eFLAZ_Zone1, tr("Zone 1"), false));
m_AudioZones.append(new tFusionLinkAudioZone(*this, eFLAZ_Zone2, tr("Zone 2"), true));
m_AudioZones.append(new tFusionLinkAudioZone(*this, eFLAZ_Zone3, tr("Zone 3"), true));
m_AudioZones.append(new tFusionLinkAudioZone(*this, eFLAZ_Zone4, tr("Zone 4"), true));
m_AudioZones.append(new tFusionLinkAudioZone(*this, eFLAZ_Global, tr("All Zones"), false));
m_pInitStateTimer = new QTimer(this);
m_pInitStateTimer->setSingleShot(true);
Connect( m_pInitStateTimer, SIGNAL(timeout()), this, SLOT(OnInitStateTimerTimeout()) );
m_MediaTrackInfo.Clear();
m_DvdInfo.Clear();
// Register so that the Device List dialogs know we implement tINDP2kDeviceFirmwareUpgrader.
m_rNDP2k.RegisterDeviceFirmwareUpgrader(this);
#if 1 // TODO_MCB remove
Connect(m_AudioZones[eFLAZ_Zone1], SIGNAL(VolumeLevelChanged(int)), this, SLOT(ForwardVolumeLevelChangedToOldInterface()));
Connect(m_AudioZones[eFLAZ_Zone2], SIGNAL(VolumeLevelChanged(int)), this, SLOT(ForwardVolumeLevelChangedToOldInterface()));
Connect(m_AudioZones[eFLAZ_Zone3], SIGNAL(VolumeLevelChanged(int)), this, SLOT(ForwardVolumeLevelChangedToOldInterface()));
Connect(m_AudioZones[eFLAZ_Zone4], SIGNAL(VolumeLevelChanged(int)), this, SLOT(ForwardVolumeLevelChangedToOldInterface()));
#endif
}
#if 1 // TODO_MCB remove
void tFusionLinkClient::ForwardVolumeLevelChangedToOldInterface()
{
if (sender() == m_AudioZones[eFLAZ_Zone1])
{
emit VolumeLevel( eAZ_Zone1, (quint8)m_AudioZones[eFLAZ_Zone1]->GetVolumeLevel() );
}
if (sender() == m_AudioZones[eFLAZ_Zone2])
{
emit VolumeLevel( eAZ_Zone2, (quint8)m_AudioZones[eFLAZ_Zone2]->GetVolumeLevel() );
}
if (sender() == m_AudioZones[eFLAZ_Zone3])
{
emit VolumeLevel( eAZ_Zone3, (quint8)m_AudioZones[eFLAZ_Zone3]->GetVolumeLevel() );
}
if (sender() == m_AudioZones[eFLAZ_Zone4])
{
emit VolumeLevel( eAZ_Zone4, (quint8)m_AudioZones[eFLAZ_Zone4]->GetVolumeLevel() );
}
}
#endif
//-----------------------------------------------------------------------------
//! dtor
//-----------------------------------------------------------------------------
tFusionLinkClient::~tFusionLinkClient()
{
m_rNDP2k.UnregisterDeviceFirmwareUpgrader(this);
// Qt will auto delete m_InitStateTimer because we are parent of it.
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::SetNmea2kTransport( tFusionLinkNmea2kTransport& transport )
{
// if there was an old transport it was deleted by discovery
// so we don't have to worry about cleanup
m_pNmea2kTransport = &transport;
Connect( m_pNmea2kTransport, SIGNAL(DataReceived( tFusionData )), this, SLOT(DataReceived( tFusionData )));
GoToInitStateProbingPowerState();
}
//! Return false because this is a FUSION device,
//! except return true if it is a SonicHub2.
bool tFusionLinkClient::IsSonicHubFamily() const
{
return m_pNmea2kTransport ? m_pNmea2kTransport->IsSonicHub2() : false;
}
//-----------------------------------------------------------------------------
//! tFusionLinkClient supports:
//! iPod: eRM_RepeatOff, eRM_RepeatOne, eRM_RepeatAll;
//! USB: eRM_RepeatOff, eRM_RepeatFolder.
//-----------------------------------------------------------------------------
QList<int> tFusionLinkClient::GetSupportedRepeatModes( quint8 sourceId ) const
{
QList<int> list;
switch( GetSourceType(sourceId) )
{
case eST_Ipod:
{
list << eRM_RepeatOff;
list << eRM_RepeatOne;
list << eRM_RepeatAll;
}
break;
case eST_USB:
{
list << eRM_RepeatOff;
list << eRM_RepeatFolder;
}
break;
case eST_MTP:
{
list << eRM_RepeatOff;
list << eRM_RepeatFolder;
}
break;
default:
// nothing is supported
break;
}
return list;
}
//-----------------------------------------------------------------------------
//! tFusionLinkClient supports:
//! iPod: eSM_ShuffleOff, eSM_ShuffleTracks, eSM_ShuffleAlbums;
//! USB: eSM_ShuffleOff, eSM_ShuffleAll.
//-----------------------------------------------------------------------------
QList<int> tFusionLinkClient::GetSupportedShuffleModes( quint8 sourceId ) const
{
QList<int> list;
switch( GetSourceType(sourceId) )
{
case eST_Ipod:
{
list << eSM_ShuffleOff;
list << eSM_ShuffleTracks;
list << eSM_ShuffleAlbums;
}
break;
case eST_USB:
{
list << eSM_ShuffleOff;
list << eSM_ShuffleAll;
}
break;
case eST_MTP:
{
list << eSM_ShuffleOff;
list << eSM_ShuffleAll;
}
break;
default:
// nothing is supported
break;
}
return list;
}
//-----------------------------------------------------------------------------
//! tFusionLinkClient supports:
//! eWMRewind, eWMFastForward are not supported by MTP/Bluetooth
//! NSW-22367 Yes they are now.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::HasRewindFastForward( quint8 sourceId ) const
{
QList<int> list;
switch( GetSourceType(sourceId) )
{
case eST_USB:
case eST_DVD:
case eST_Ipod:
case eST_MTP:
case eST_Bluetooth:
return true;
default:
return false;
}
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::IsOnAndInitialized() const
{
return (m_InitState == eInitStatePoweredUp);
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::IsMuted( quint8 /*zoneId*/ ) const
{
return m_Mute == eS_On;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
tFusionClient::eSourceType tFusionLinkClient::GetSourceType( quint8 sourceId ) const
{
if( m_Sources.contains( sourceId ) )
{
return m_Sources.value( sourceId ).m_Type;
}
return eST_Invalid;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
tFusionClient::ePowerState tFusionLinkClient::GetPowerState() const
{
return m_PowerState;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
QString tFusionLinkClient::GetSourceName( quint8 sourceId ) const
{
return m_Sources.value( sourceId ).m_Name;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
QList< quint8 > tFusionLinkClient::GetSourcesIds() const
{
QList< quint8 > result;
foreach( tSourceInfo info, m_Sources.values() )
{
if ((info.m_Flags & eSTF_Enabled) == eSTF_Enabled)
{
result << info.m_SourceId;
}
}
return result;
}
//! Implements tFusionClient::GetCurrentSourceId for FusionLink.
quint8 tFusionLinkClient::GetCurrentSourceId( quint8 ) const
{
if (IsOnAndInitialized())
{
return m_SourceId;
}
else
{
return cFusionInvalidSourceId;
}
}
//! Implements tFusionClient::GetZoneCount for FusionLink.
//! Returns number of implemented zones as reported by server.
uint tFusionLinkClient::GetZoneCount() const
{
return m_ZoneCount;
}
//! Implements tFusionClient::GetAudioZone for FusionLink.
tFusionAudioZone& tFusionLinkClient::GetAudioZone( uint zoneIndex )
{
if (zoneIndex < m_ZoneCount)
{
return *m_AudioZones[zoneIndex];
}
else
{
Assert(false);
return tNullAudioZone::g_NullAudioZone;
}
}
//! Implements tFusionClient::HasGlobalAudioZone for FusionLink.
//! Returns true if the server reported any capabilities for the global zone.
bool tFusionLinkClient::HasGlobalAudioZone() const
{
return m_hasGlobalZone;
}
//! Implements tFusionClient::GetGlobalAudioZone for FusionLink.
tFusionAudioZone& tFusionLinkClient::GetGlobalAudioZone()
{
if (m_hasGlobalZone)
{
return *m_AudioZones[eFLAZ_Global];
}
else
{
Assert(false);
return tNullAudioZone::g_NullAudioZone;
}
}
//! Implements tFusionClient::GetRepeatMode for FusionLink.
tFusionClient::eRepeatMode tFusionLinkClient::GetRepeatMode( quint8 sourceId, quint8 /*zoneId*/ ) const
{
switch( GetSourceType(sourceId) )
{
case eST_Ipod: return m_IpodRepeatMode;
case eST_USB: return m_UsbRepeatMode;
case eST_MTP: return m_MtpRepeatMode;
default: Assert(false); return eRM_RepeatOff;
}
}
//! Implements tFusionClient::GetShuffleMode for FusionLink.
tFusionClient::eShuffleMode tFusionLinkClient::GetShuffleMode( quint8 sourceId, quint8 /*zoneId*/ ) const
{
switch( GetSourceType(sourceId) )
{
case eST_Ipod: return m_IpodShuffleMode;
case eST_USB: return m_UsbShuffleMode;
case eST_MTP: return m_MtpShuffleMode;
default: Assert(false); return eSM_ShuffleOff;
}
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
quint16 tFusionLinkClient::GetMediaFlags( quint8 sourceId, quint8 /*zoneId*/ ) const
{
if( m_Sources.contains( sourceId ) )
{
return m_Sources.value( sourceId ).m_MediaFlags;
}
return 0;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
tFusionClient::tMediaTrackInfo tFusionLinkClient::GetMediaTrackInfo( quint8 /*sourceId*/, quint8 /*zoneId*/ ) const
{
return m_MediaTrackInfo;
}
//-----------------------------------------------------------------------------
//! Implement tFusionClient::GetAuxGain() for FusionLink.
//-----------------------------------------------------------------------------
qint8 tFusionLinkClient::GetAuxGain( quint8 sourceId ) const
{
if ( m_Sources.contains(sourceId) )
{
Assert( m_Sources.value(sourceId).m_Type == eST_Aux );
return m_Sources.value(sourceId).m_AuxGain.Desired();
}
else
{
Assert(false);
return 0;
}
}
//-----------------------------------------------------------------------------
//! virtual slot
//-----------------------------------------------------------------------------
bool tFusionLinkClient::IsMarineScanModeOn( quint8 /*sourceId*/ ) const
{
return m_ScanOn == eS_On;
}
//-----------------------------------------------------------------------------
//! virtual slot
//-----------------------------------------------------------------------------
quint8 tFusionLinkClient::GetMarineSquelch( quint8 sourceId ) const
{
if ( m_Sources.contains(sourceId) )
{
Assert( m_Sources.value(sourceId).m_Type == eST_VHF );
return m_Sources.value(sourceId).m_MarineSquelch.Desired();
}
else
{
Assert(false);
return 0;
}
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
QList< tFusionClient::tRadioFavorite > tFusionLinkClient::GetAMFavorites() const
{
QList< tFusionClient::tRadioFavorite > list;
foreach( uint freq, ActiveFavorites( m_AMPresets ) )
{
list << tRadioFavorite( freq, freq, QString() );
}
return list;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
QList< tFusionClient::tRadioFavorite > tFusionLinkClient::GetFMFavorites() const
{
QList< tFusionClient::tRadioFavorite > list;
foreach( uint freq, ActiveFavorites( m_FMPresets ) )
{
list << tRadioFavorite( freq, freq, QString() );
}
return list;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
QList< tFusionClient::tRadioFavorite > tFusionLinkClient::GetVHFFavorites() const
{
QList< tFusionClient::tRadioFavorite > list;
foreach( uint freq, ActiveFavorites( m_VHFPresets ) )
{
list << tRadioFavorite( freq, freq, QString() );
}
return list;
}
//-----------------------------------------------------------------------------
//! virtual slot
//-----------------------------------------------------------------------------
tFusionLinkClient::tDvdInfo tFusionLinkClient::GetDvdInfo() const
{
return m_DvdInfo;
}
//-----------------------------------------------------------------------------
//! virtual slot
//-----------------------------------------------------------------------------
bool tFusionLinkClient::IsZone2LinkedToZone1() const
{
return m_Zone2Linked;
}
//-----------------------------------------------------------------------------
//! virtual slot
//-----------------------------------------------------------------------------
void tFusionLinkClient::PowerUp()
{
// Only start a new power up if not already booting.
// The media bars call this quite often and we don't want
// to hijack / abort any initialization already in progress.
if ( (m_InitState != eInitStateGettingState) && (m_InitState != eInitStateGettingMenuLockId) && (m_InitState != eInitStatePoweredUp))
{
SendSetPowerState(eFLPS_On);
m_InitState = eInitStatePoweringOn;
m_pInitStateTimer->start(CommunicationTimeoutInterval);
UpdatePowerState(ePS_Booting);
}
}
//-----------------------------------------------------------------------------
//! virtual slot
//-----------------------------------------------------------------------------
void tFusionLinkClient::PowerDown( bool /*poweringDown*/ ) // TODO poweringDown argument seems to be useless, perhaps tSonicHubClient also shouldn't use it?
{
SendSetPowerState( eFLPS_Off );
m_pInitStateTimer->start(CommunicationTimeoutInterval);
}
//-----------------------------------------------------------------------------
//! virtual slot
//-----------------------------------------------------------------------------
bool tFusionLinkClient::TunerControl( quint8 sourceId, eTunerCommand cmd, quint32 frequency )
{
if( eTC_GotoFavourite == cmd )
{
cmd = eTC_GotoFreq; // In fusion link protocol we are sending freq not fav ID
}
tFusionData data( 8 );
data.AddValue< quint16 >( fapiTunerControl );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
data.AddValue< quint8 >( static_cast< quint8 >( cmd ) );
data.AddValue< quint32 >( frequency );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! virtual slot
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetTunerRegion( tFusionClient::eTunerRegion tunerRegion )
{
switch( tunerRegion )
{
case eTR_USA:
return SendSetSetting( eFLSI_SelectTunerRegion, eFLTR_USA );
break;
case eTR_Europe:
return SendSetSetting( eFLSI_SelectTunerRegion, eFLTR_Europe );
break;
case eTR_Japan:
return SendSetSetting( eFLSI_SelectTunerRegion, eFLTR_Japan );
break;
case eTR_Australasia:
return SendSetSetting( eFLSI_SelectTunerRegion, eFLTR_Australasia );
break;
default:
Assert(false);
return false;
break;
}
}
//-----------------------------------------------------------------------------
//! virtual slot
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetPowerState( eFusionLinkPowerState state )
{
tFusionData data( 3 );
data.AddValue< quint16 >( fapiSetPowerState );
data.AddValue< quint8 >( static_cast<quint8>(state) );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! virtual slot
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetSource( quint8 sourceId, quint8 /*zoneId*/ )
{
tFusionData data( 3 );
data.AddValue< quint16 >( fapiSetSource );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! virtual slot
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetMute( tFusionClient::eState state, quint8 /*zoneId*/ )
{
Assert( (state == eS_On) || (state == eS_Off) );
tFusionData data( 3 );
data.AddValue< quint16 >( fapiSetMute );
// Convert from tFusionClient::eState to FusionLink.
switch( state )
{
case eS_On:
{
data.AddValue< quint8 >( eFLMS_MuteOn );
}
break;
case eS_Off:
{
data.AddValue< quint8 >( eFLMS_MuteOff );
}
break;
case eS_Invalid:
default:
{
return false;
}
break;
}
return SendData( data );
}
//-----------------------------------------------------------------------------
//! Send fapiSetBalance using data from m_AudioZones[zone].
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetBalance( quint8 zone )
{
tFusionData data( 4 );
data.AddValue< quint16 >( fapiSetBalance );
data.AddValue< quint8 >( zone );
data.AddValue< qint8 >( static_cast< qint8 >( m_AudioZones[zone]->GetBalance() ) );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! Send fapiSetLowPassFilter using data from m_AudioZones[zone].
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetLowPassFilter( quint8 zone )
{
tFusionData data( 4 );
data.AddValue< quint16 >( fapiSetLowPassFilter );
data.AddValue< quint8 >( zone );
switch( m_AudioZones[zone]->GetLowPassFilter() )
{
case tFusionAudioZone::eLPFV_55Hz:
data.AddValue< quint8 >( eFLLPFV_55Hz );
break;
case tFusionAudioZone::eLPFV_85Hz:
data.AddValue< quint8 >( eFLLPFV_85Hz );
break;
case tFusionAudioZone::eLPFV_120Hz:
data.AddValue< quint8 >( eFLLPFV_120Hz );
break;
case tFusionAudioZone::eLPFV_160Hz:
data.AddValue< quint8 >( eFLLPFV_160Hz );
break;
default:
return false;
}
return SendData( data );
}
//-----------------------------------------------------------------------------
//! Send fapiSetSubLevels using data from m_AudioZones.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetSubLevels()
{
tFusionData data( 6 );
data.AddValue< quint16 >( fapiSetSubLevels );
data.AddValue< quint8 >( static_cast< quint8 >( m_AudioZones[eFLAZ_Zone1]->GetSubLevel() ) );
data.AddValue< quint8 >( static_cast< quint8 >( m_AudioZones[eFLAZ_Zone2]->GetSubLevel() ) );
data.AddValue< quint8 >( static_cast< quint8 >( m_AudioZones[eFLAZ_Zone3]->GetSubLevel() ) );
data.AddValue< quint8 >( static_cast< quint8 >( m_AudioZones[eFLAZ_Zone4]->GetSubLevel() ) );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! Send fapiSeteq using data from m_AudioZones[zone].
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetEqualizer( quint8 zone )
{
tFusionData data( 6 );
data.AddValue< quint16 >( fapiSetEq );
data.AddValue< quint8 >( zone );
data.AddValue< qint8 >( static_cast< qint8 >( m_AudioZones[zone]->GetBassEqualizer() ) );
data.AddValue< qint8 >( static_cast< qint8 >( m_AudioZones[zone]->GetMiddleEqualizer() ) );
data.AddValue< qint8 >( static_cast< qint8 >( m_AudioZones[zone]->GetTrebleEqualizer() ) );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! Send fapiSetVolumeLimit using data from m_AudioZones[zone].
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetVolumeLimit( quint8 zone )
{
tFusionData data( 4 );
data.AddValue< quint16 >( fapiSetVolumeLimit );
data.AddValue< quint8 >( zone );
data.AddValue< quint8 >( static_cast< quint8 >( m_AudioZones[zone]->GetVolumeLimit() ) );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! Send fapiSetVolumes using data from m_AudioZones.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetVolumes()
{
// NSW-15571 On all FusionLink 1.20 devices I tried (MS-AV700i, MS-RA205,
// BB300=SonicHub2) the fapiSetVolumes command is ignored if mute mode
// is on. The workaround is to turn off mute mode first!
if (m_Mute == eS_On)
{
SetMute(eS_Off);
}
tFusionData data( 6 );
data.AddValue< quint16 >( fapiSetVolumes );
data.AddValue< quint8 >( static_cast<quint8>(m_AudioZones[eFLAZ_Zone1]->GetVolumeLevel()) );
data.AddValue< quint8 >( static_cast<quint8>(m_AudioZones[eFLAZ_Zone2]->GetVolumeLevel()) );
data.AddValue< quint8 >( static_cast<quint8>(m_AudioZones[eFLAZ_Zone3]->GetVolumeLevel()) );
data.AddValue< quint8 >( static_cast<quint8>(m_AudioZones[eFLAZ_Zone4]->GetVolumeLevel()) );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! Implements tFusionClient::SendZoneSettingCommands() for FusionLink.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendZoneSettingCommands()
{
bool commandWasSent = false;
// The VolumeLevel for all zones are sent together.
if( m_AudioZones[eFLAZ_Zone1]->DesiredDiffersFromActualVolumeLevel() ||
m_AudioZones[eFLAZ_Zone2]->DesiredDiffersFromActualVolumeLevel() ||
m_AudioZones[eFLAZ_Zone3]->DesiredDiffersFromActualVolumeLevel() ||
m_AudioZones[eFLAZ_Zone4]->DesiredDiffersFromActualVolumeLevel() )
{
SendSetVolumes();
commandWasSent = true;
}
// The SubLevel for all zones are sent together.
if( m_AudioZones[eFLAZ_Zone1]->DesiredDiffersFromActualSubLevel() ||
m_AudioZones[eFLAZ_Zone2]->DesiredDiffersFromActualSubLevel() ||
m_AudioZones[eFLAZ_Zone3]->DesiredDiffersFromActualSubLevel() ||
m_AudioZones[eFLAZ_Zone4]->DesiredDiffersFromActualSubLevel() )
{
SendSetSubLevels();
commandWasSent = true;
}
// the other settings are per zone
for( quint8 zoneIndex = 0; zoneIndex < m_AudioZones.size(); ++zoneIndex)
{
if (m_AudioZones[zoneIndex]->DesiredDiffersFromActualVolumeLimit())
{
SendSetVolumeLimit(zoneIndex);
commandWasSent = true;
}
if (m_AudioZones[zoneIndex]->DesiredDiffersFromActualBalance())
{
SendSetBalance(zoneIndex);
commandWasSent = true;
}
if (m_AudioZones[zoneIndex]->DesiredDiffersFromActualLowPassFilter())
{
SendSetLowPassFilter(zoneIndex);
commandWasSent = true;
}
if( m_AudioZones[zoneIndex]->DesiredDiffersFromActualBassEqualizer() ||
m_AudioZones[zoneIndex]->DesiredDiffersFromActualMiddleEqualizer() ||
m_AudioZones[zoneIndex]->DesiredDiffersFromActualTrebleEqualizer() )
{
SendSetEqualizer(zoneIndex);
commandWasSent = true;
}
}
// There are also some source settings sent on the same timer.
QMap<quint16, tSourceInfo>::iterator iSource;
for ( iSource = m_Sources.begin(); iSource != m_Sources.end(); ++iSource )
{
if ( iSource->m_Type == eST_VHF )
{
if ( iSource->m_MarineSquelch.DesiredDiffersFromActual() )
{
SendSetMarineSquelch( iSource->m_SourceId, iSource->m_MarineSquelch.Desired() );
commandWasSent = true;
}
}
if ( iSource->m_Type == eST_Aux )
{
if ( iSource->m_AuxGain.DesiredDiffersFromActual() )
{
SendSetAuxGain( iSource->m_SourceId, iSource->m_AuxGain.Desired() );
commandWasSent = true;
}
}
}
return commandWasSent;
}
//-----------------------------------------------------------------------------
//! Implements tFusionClient::ResetZoneSettingDesiredToActual() for FusionLink.
//-----------------------------------------------------------------------------
void tFusionLinkClient::ResetZoneSettingDesiredToActual()
{
for( quint8 zoneIndex = 0; zoneIndex < m_AudioZones.size(); ++zoneIndex)
{
m_AudioZones[zoneIndex]->ResetDesiredToActual();
}
QMap<quint16, tSourceInfo>::iterator iSource;
for ( iSource = m_Sources.begin(); iSource != m_Sources.end(); ++iSource )
{
iSource->m_MarineSquelch.ResetDesiredToActual();
iSource->m_AuxGain.ResetDesiredToActual();
}
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetMedia( quint8 sourceId, eFusionLinkSetMediaCommand cmd )
{
tFusionData data( 4 );
data.AddValue< quint16 >( fapiSetMedia );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
data.AddValue< quint8 >( static_cast< quint8 >( cmd ) );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetMedia( quint8 sourceId, quint8 /*zoneId*/, eMediaCommand cmd )
{
switch( cmd )
{
case eMC_Play:
return SendSetMedia( sourceId, eFLSMC_Play );
break;
case eMC_Pause:
return SendSetMedia( sourceId, eFLSMC_Pause );
break;
case eMC_FastFwd:
return SendSetMedia( sourceId, eFLSMC_FastForward );
break;
case eMC_SkipFwd:
return SendSetMedia( sourceId, eFLSMC_SkipForward );
break;
case eMC_Rwnd:
return SendSetMedia( sourceId, eFLSMC_Rewind );
break;
case eMC_SkipBack:
return SendSetMedia( sourceId, eFLSMC_SkipBack );
break;
default:
Assert(false);
return false;
break;
}
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetRepeatMode( quint8 sourceId, quint8 /*zoneId*/, eRepeatMode mode )
{
tFusionClient::eSourceType sourceType = GetSourceType( sourceId );
if( sourceType == eST_Ipod )
{
switch( mode )
{
case eRM_RepeatOff:
return SendSetSetting( eFLSI_IpodRepeat, eFLIpodRepeatOff );
break;
case eRM_RepeatOne:
return SendSetSetting( eFLSI_IpodRepeat, eFLIpodRepeatOne );
break;
case eRM_RepeatFolder:
//qDebug() << "Unsupported repeat mode";
Assert(false);
return false;
break;
case eRM_RepeatAll:
return SendSetSetting( eFLSI_IpodRepeat, eFLIpodRepeatAll );
break;
default:
//qDebug() << "Wrong repeat mode";
Assert(false);
return false;
break;
}
}
else if( sourceType == eST_USB )
{
switch( mode )
{
case eRM_RepeatOff:
return SendSetSetting( eFLSI_UsbRepeat, eFLUsbRepeatOff );
break;
case eRM_RepeatOne:
//qDebug() << "Unsupported repeat mode";
Assert(false);
return false;
break;
case eRM_RepeatFolder:
return SendSetSetting( eFLSI_UsbRepeat, eFLUsbRepeatFolder );
break;
case eRM_RepeatAll:
//qDebug() << "Unsupported repeat mode";
Assert(false);
return false;
break;
default:
//qDebug() << "Wrong repeat mode";
Assert(false);
return false;
break;
}
}
else if( sourceType == eST_MTP )
{
switch( mode )
{
case eRM_RepeatOff:
return SendSetSetting( eFLSI_MtpRepeat, eFLMtpRepeatOff );
break;
case eRM_RepeatOne:
//qDebug() << "Unsupported repeat mode";
Assert(false);
return false;
break;
case eRM_RepeatFolder:
return SendSetSetting( eFLSI_MtpRepeat, eFLMtpRepeatFolder );
break;
case eRM_RepeatAll:
//qDebug() << "Unsupported repeat mode";
Assert(false);
return false;
break;
default:
//qDebug() << "Wrong repeat mode";
Assert(false);
return false;
break;
}
}
else
{
//qDebug() << "Wrong media type";
Assert(false);
return false;
}
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetShuffleMode( quint8 sourceId, quint8 /*zoneId*/, eShuffleMode mode )
{
tFusionClient::eSourceType sourceType = GetSourceType( sourceId );
if( sourceType == eST_Ipod )
{
switch( mode )
{
case eSM_ShuffleOff:
return SendSetSetting( eFLSI_IpodShuffle, eFLIpodShuffleOff );
break;
case eSM_ShuffleTracks:
return SendSetSetting( eFLSI_IpodShuffle, eFLIpodShuffleTracks );
break;
case eSM_ShuffleAlbums:
return SendSetSetting( eFLSI_IpodShuffle, eFLIpodShuffleAlbums );
break;
case eSM_ShuffleAll:
//qDebug() << "Unsupported shuffle mode";
Assert(false);
return false;
break;
default:
//qDebug() << "Wrong shuffle mode";
Assert(false);
return false;
break;
}
}
else if( sourceType == eST_USB )
{
switch( mode )
{
case eSM_ShuffleOff:
return SendSetSetting( eFLSI_UsbShuffle, eFLUsbShuffleOff );
break;
case eSM_ShuffleTracks:
//qDebug() << "Unsupported shuffle mode";
Assert(false);
return false;
break;
case eSM_ShuffleAlbums:
//qDebug() << "Unsupported shuffle mode";
Assert(false);
return false;
break;
case eSM_ShuffleAll:
return SendSetSetting( eFLSI_UsbShuffle, eFLUsbShuffleAll );
break;
default:
//qDebug() << "Wrong shuffle mode";
Assert(false);
return false;
break;
}
}
else if( sourceType == eST_MTP )
{
switch( mode )
{
case eSM_ShuffleOff:
return SendSetSetting( eFLSI_MtpShuffle, eFLMtpShuffleOff );
break;
case eSM_ShuffleTracks:
//qDebug() << "Unsupported shuffle mode";
Assert(false);
return false;
break;
case eSM_ShuffleAlbums:
//qDebug() << "Unsupported shuffle mode";
Assert(false);
return false;
break;
case eSM_ShuffleAll:
return SendSetSetting( eFLSI_MtpShuffle, eFLMtpShuffleAll );
break;
break;
default:
//qDebug() << "Wrong shuffle mode";
Assert(false);
return false;
break;
}
}
else
{
//qDebug() << "Wrong media type";
Assert(false);
return false;
}
}
//-----------------------------------------------------------------------------
//! Implement tFusionClient::SetAuxGain() for FusionLink.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetAuxGain( quint8 sourceId, qint8 gain )
{
if ( m_Sources.contains(sourceId) )
{
Assert( m_Sources.value(sourceId).m_Type == eST_Aux );
if ( m_Sources[sourceId].m_AuxGain.ChangeDesired(gain) )
{
StartZoneSettingTimer();
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit AuxGain(sourceId, gain);
}
}
return true;
}
else
{
Assert(false);
return false;
}
}
//-----------------------------------------------------------------------------
//! Send fapiSetAuxGain to the server.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetAuxGain( quint8 sourceId, qint8 gain )
{
Assert( (MinAuxGain() <= gain) && (gain <= MaxAuxGain()) );
tFusionData data( 4 );
data.AddValue< quint16 >( fapiSetAuxGain );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
data.AddValue< qint8 >( gain );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetMenuAction( quint8 sourceId, quint8 /*zoneId*/, quint32 index, tFusionClient::eMenuAction action )
{
if( m_MenuLockId != 0 )
{
switch( action )
{
case eMA_Open: return SendSetMenuAction( sourceId, index, eFLMA_Open );
case eMA_SelectItem: return SendSetMenuAction( sourceId, index, eFLMA_SelectItem );
case eMA_StepBack: return SendSetMenuAction( sourceId, index, eFLMA_StepBack );
case eMA_Close: return SendSetMenuAction( sourceId, index, eFLMA_Close );
case eMA_Exit: return SendSetMenuAction( sourceId, index, eFLMA_Exit );
case eMA_StepBackToRoot:
// need to send an exit then open, it will open back up at root.
// Set flag as we need to stop MenuClose from the exit command going
// to the UI and then send the open command
m_SteppingBackToRoot = true;
return SendSetMenuAction( sourceId, 0, eFLMA_Exit );
default:
Assert(false);
return false;
}
}
else
{
DbgPrintf( "Menu lock ID not available - set menu action denied" );
return false;
}
}
//-----------------------------------------------------------------------------
//! Send fapiSetMenuAction to the server.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetMenuAction( quint8 sourceId, quint32 index, eFusionLinkMenuAction action )
{
Assert(m_MenuLockId != 0);
tFusionData data( 9 );
data.AddValue< quint16 >( fapiSetMenuAction );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
data.AddValue< quint32 >( index );
data.AddValue< quint8 >( static_cast<quint8>(action) );
data.AddValue< quint8 >( m_MenuLockId );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::GetMenuItemCount( quint8 sourceId )
{
if( m_MenuLockId )
{
tFusionData data( 4 );
data.AddValue< quint16 >( fapiGetMenuCount );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
data.AddValue< quint8 >( m_MenuLockId );
return SendData( data );
}
DbgPrintf( "Menu lock ID not available - get menu items count denied" );
return false;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::GetMenuItem( quint8 sourceId, quint32 index, quint32 /*count*/ )
{
if( m_MenuLockId )
{
tFusionData data( 12 );
data.AddValue< quint16 >( fapiGetMenuItem );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
data.AddValue< quint32 >( index );
// current UI only support fetching one item at the time
data.AddValue< quint32 >( 1 );
data.AddValue< quint8 >( m_MenuLockId );
return SendData( data );
}
DbgPrintf( "Menu lock ID not available - get menu item denied" );
return false;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::MarineTunerControl( quint8 sourceId, tFusionClient::eMarineTunnerCommand cmd, quint8 channel)
{
if( eMTC_GotoFavourite == cmd )
{
cmd = eMTC_GotoChannel; // Hack to make fusion compatible with new api
}
tFusionData data( 5 );
data.AddValue< quint16 >( fapiMarineTunerControl );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
data.AddValue< quint8 >( static_cast< quint8 >( cmd ) );
data.AddValue< quint8 >( channel );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! Implement tFusionClient::SetMarineSquelch() for FusionLink.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetMarineSquelch( quint8 sourceId, quint8 squelch )
{
if ( m_Sources.contains(sourceId) )
{
Assert( m_Sources.value(sourceId).m_Type == eST_VHF );
if ( m_Sources[sourceId].m_MarineSquelch.ChangeDesired(squelch) )
{
StartZoneSettingTimer();
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit MarineSquelch(sourceId, squelch);
}
}
return true;
}
else
{
Assert(false);
return false;
}
}
//-----------------------------------------------------------------------------
//! Send fapiSetMarineSquelch to server.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetMarineSquelch( quint8 sourceId, quint8 squelch )
{
Assert( squelch <= cSquelchMax );
tFusionData data( 4 );
data.AddValue< quint16 >( fapiSetMarineSquelch );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
data.AddValue< qint8 >( squelch );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetMarineScanMode( quint8 sourceId, eState state )
{
Assert( (state == eS_On) || (state == eS_Off) );
tFusionData data( 4 );
data.AddValue< quint16 >( fapiSetMarineScanMode );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
// Convert from tFusionClient::eState to FusionLink.
switch( state )
{
case eS_On:
{
data.AddValue< quint8 >( eFLMSS_EnableScan );
}
break;
case eS_Off:
{
data.AddValue< quint8 >( eFLMSS_DisableScan );
}
break;
case eS_Invalid:
default:
{
return false;
}
break;
}
return SendData( data );
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetMarineRegion( tFusionClient::eMarineRegion marineRegion )
{
Assert( eMR_USA <= marineRegion && marineRegion <= eMR_International );
switch( marineRegion )
{
case eMR_USA: return SendSetSetting( eFLSI_SelectMarineRegion, eFLMR_USA );
case eMR_Canada: return SendSetSetting( eFLSI_SelectMarineRegion, eFLMR_Canada );
case eMR_International: return SendSetSetting( eFLSI_SelectMarineRegion, eFLMR_International );
default: Assert(false); return false;
}
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
uint tFusionLinkClient::SaveAMFavorite( uint favorite )
{
uint index = FirstFreeFavorite( m_AMPresets );
if( index < cMaxFavorites )
{
if( SendSetSetting( static_cast<eFusionLinkSettingId>(index + eFLSI_AMPreset0), favorite ) )
{
return favorite;
}
}
Assert(false);
return 0;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
uint tFusionLinkClient::SaveFMFavorite( uint favorite )
{
uint index = FirstFreeFavorite( m_FMPresets );
if( index < cMaxFavorites )
{
if( SendSetSetting( static_cast<eFusionLinkSettingId>(index + eFLSI_FMPreset0), favorite ) )
{
return favorite;
}
}
Assert(false);
return 0;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
uint tFusionLinkClient::SaveVHFFavorite( uint favorite )
{
uint index = FirstFreeFavorite( m_VHFPresets );
if( index < cMaxFavorites )
{
if( SendSetSetting( static_cast<eFusionLinkSettingId>(index + eFLSI_VHFPreset0), favorite ) )
{
return favorite;
}
}
Assert(false);
return 0;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::RemoveAMFavorite( uint favorite )
{
int index = m_AMPresets.indexOf( favorite );
if( index < cMaxFavorites )
{
return SendSetSetting( static_cast<eFusionLinkSettingId>(index + eFLSI_AMPreset0), 0 );
}
Assert(false);
return false;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::RemoveFMFavorite( uint favorite )
{
int index = m_FMPresets.indexOf( favorite );
if( index < cMaxFavorites )
{
return SendSetSetting( static_cast<eFusionLinkSettingId>(index + eFLSI_FMPreset0), 0 );
}
Assert(false);
return false;
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::RemoveVHFFavorite( uint favorite )
{
int index = m_VHFPresets.indexOf( favorite );
if( index < cMaxFavorites )
{
return SendSetSetting( static_cast<eFusionLinkSettingId>(index + eFLSI_VHFPreset0), 0 );
}
Assert(false);
return false;
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendDvdControl( quint8 sourceId, eFusionLinkDvdControlCommands cmd )
{
tFusionData data( 4 );
data.AddValue< quint16 >( fapiDvdControl );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
data.AddValue< quint8 >( static_cast< quint8 >( cmd ) );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::DVDControl( quint8 sourceId, tFusionClient::eDVDCommand cmd )
{
switch( cmd )
{
case eDC_Play:
return SendDvdControl( sourceId, eFLDCC_Play );
break;
case eDC_Pause:
return SendDvdControl( sourceId, eFLDCC_Pause );
break;
case eDC_Stop:
return SendDvdControl( sourceId, eFLDCC_Stop );
break;
case eDC_NextTrack:
return SendDvdControl( sourceId, eFLDCC_NextTrack );
break;
case eDC_PreviousTrack:
return SendDvdControl( sourceId, eFLDCC_PreviousTrack );
break;
case eDC_FastForward:
return SendDvdControl( sourceId, eFLDCC_FastForward );
break;
case eDC_Rewind:
return SendDvdControl( sourceId, eFLDCC_Rewind );
break;
case eDC_Eject:
return SendDvdControl( sourceId, eFLDCC_Eject );
break;
default:
Assert(false);
return false;
break;
}
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendDvdIrKey( quint8 sourceId, eFusionLinkDvdIrKeyCommands key )
{
tFusionData data( 4 );
data.AddValue< quint16 >( fapiDvdControl );
data.AddValue< quint8 >( static_cast<quint8>( sourceId ) );
data.AddValue< quint8 >( static_cast< quint8 >( key ) );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! virtual
//-----------------------------------------------------------------------------
bool tFusionLinkClient::DVDIrKey( quint8 sourceId, tFusionClient::eDVDIrKey key )
{
switch( key )
{
case eDIK_SetupMenu:
return SendDvdIrKey( sourceId, eFLDIKC_SetupMenu );
break;
case eDIK_SetupUp:
return SendDvdIrKey( sourceId, eFLDIKC_SetupUp );
break;
case eDIK_SetupDown:
return SendDvdIrKey( sourceId, eFLDIKC_SetupDown );
break;
case eDIK_SetupLeft:
return SendDvdIrKey( sourceId, eFLDIKC_SetupLeft );
break;
case eDIK_SetupRight:
return SendDvdIrKey( sourceId, eFLDIKC_SetupRight );
break;
case eDIK_SetupEnter:
return SendDvdIrKey( sourceId, eFLDIKC_SetupEnter );
break;
case eDIK_SetupSlow:
return SendDvdIrKey( sourceId, eFLDIKC_SetupSlow );
break;
case eDIK_SetupSetup:
return SendDvdIrKey( sourceId, eFLDIKC_SetupSetup );
break;
case eDIK_SetupZoom:
return SendDvdIrKey( sourceId, eFLDIKC_SetupZoom );
break;
case eDIK_SetupSubt:
return SendDvdIrKey( sourceId, eFLDIKC_SetupSubt );
break;
case eDIK_Setup1:
return SendDvdIrKey( sourceId, eFLDIKC_Setup1 );
break;
case eDIK_Setup2:
return SendDvdIrKey( sourceId, eFLDIKC_Setup2 );
break;
case eDIK_Setup3:
return SendDvdIrKey( sourceId, eFLDIKC_Setup3 );
break;
case eDIK_Setup4:
return SendDvdIrKey( sourceId, eFLDIKC_Setup4 );
break;
case eDIK_Setup5:
return SendDvdIrKey( sourceId, eFLDIKC_Setup5 );
break;
case eDIK_Setup6:
return SendDvdIrKey( sourceId, eFLDIKC_Setup6 );
break;
case eDIK_Setup7:
return SendDvdIrKey( sourceId, eFLDIKC_Setup7 );
break;
case eDIK_Setup8:
return SendDvdIrKey( sourceId, eFLDIKC_Setup8 );
break;
case eDIK_Setup9:
return SendDvdIrKey( sourceId, eFLDIKC_Setup9 );
break;
case eDIK_Setup0:
return SendDvdIrKey( sourceId, eFLDIKC_Setup0 );
break;
case eDIK_Setup10P:
return SendDvdIrKey( sourceId, eFLDIKC_Setup10P );
break;
case eDIK_Random:
return SendDvdIrKey( sourceId, eFLDIKC_Random );
break;
case eDIK_FastForward:
return SendDvdIrKey( sourceId, eFLDIKC_FastForward );
break;
case eDIK_Rewind:
return SendDvdIrKey( sourceId, eFLDIKC_Rewind );
break;
case eDIK_Display:
return SendDvdIrKey( sourceId, eFLDIKC_Display );
break;
case eDIK_Repeat:
return SendDvdIrKey( sourceId, eFLDIKC_Repeat );
break;
case eDIK_OSD:
return SendDvdIrKey( sourceId, eFLDIKC_OSD );
break;
default:
Assert(false);
return false;
break;
}
}
//-----------------------------------------------------------------------------
//! Send fapiUpdateFW for the given type.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendUpdateFirmware( eFusionLinkFirmwareType type )
{
tFusionData data( 3 );
data.AddValue< quint16 >( fapiUpdateFW );
data.AddValue< quint8 >( static_cast<quint8>(type) );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! Slot to start firmware update of server.
//-----------------------------------------------------------------------------
void tFusionLinkClient::UpdateFirmwareOfHeadUnit()
{
SendUpdateFirmware(eFLFT_HeadUnit);
}
//-----------------------------------------------------------------------------
//! Slot to start firmware update of MS-NRX200 remotes from our server.
//-----------------------------------------------------------------------------
void tFusionLinkClient::UpdateFirmwareOfNrx200Remotes()
{
SendUpdateFirmware(eFLFT_NRX200);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::DataReceived( tFusionData data )
{
//DbgPrintf("FusionLink(%d): %s", int(data.Source()), QByteArray((const char*)data.Data(), int(data.DataSize())).toHex().constData());
quint16 command = data.Value< quint16 >();
// Server commands have high bit set, client commands have high bit clear.
if( command & 0x8000 )
{
// In normal operation, any message from the server should reset the state timeout timer.
if (m_InitState == eInitStatePoweredUp)
{
// start() is also restart.
m_pInitStateTimer->start();
}
// Process the different commands.
switch( command )
{
case fapiAPIVersion:
{
quint16 major = data.Value< quint16 >();
quint16 minor = data.Value< quint16 >();
DbgPrintf( "Current API version: %d.%d", major, minor );
}
break;
case fapiSource:
{
quint8 sourceId = data.Value< quint8 >(); // source ID of data to be updated
m_SourceId = data.Value< quint8 >(); // source ID currently in use
eSourceType type = ToFusionSourceType( data.Value< quint8 >() );
quint8 flags = data.Value< quint8 >();
quint8 length = data.Value< quint8 >();
QString name = data.ValueUtf8< QString >( length );
QString qualifiedName = (type == eST_Aux) ? GetAuxName() : name;
//DbgPrintf( "Source '%s' received with ID %d, current source ID %d, type %d", qPrintable( name ), sourceId, m_SourceId, type );
// Check if any state is changed.
tSourceInfo& info = m_Sources[ sourceId ]; // Inserts default constructed tSourceInfo if sourceId is not already in map.
bool sourceHasChanged = (info.m_SourceId != sourceId) ||
(info.m_Type != type) ||
(info.m_Name != qualifiedName) ||
(info.m_Flags != flags);
// Update local state.
info.m_SourceId = static_cast<quint8>( sourceId );
info.m_Type = type;
info.m_Name = qualifiedName;
info.m_Flags = flags;
quint16 prevMediaFlags = info.m_MediaFlags; // Needs to be here, but flags will only be changed for media types
// Update the connected/disconnected flag in info.m_MediaFlags. Only do this for media sources
if (type == eST_USB || type == eST_Ipod || type == eST_Bluetooth || type == eST_MTP)
{
info.m_MediaFlags &= ~(eMF_Connected | eMF_Disconnected | eMF_Locked | eMF_Loading | eMF_SelectDevice); // remove old flags
if (flags & eFLSF_Locked)
{
info.m_MediaFlags |= eMF_Locked;
}
else if ( flags & eFLSF_Loading)
{
info.m_MediaFlags |= eMF_Loading;
}
else if ( (type == eST_Bluetooth) && ( (flags & eFLSF_Streaming) == 0) && (flags & eFLSF_Connected) )
{
info.m_MediaFlags |= eMF_SelectDevice;
}
else if ( (flags & eFLSF_Connected) && (flags & eFLSF_Enabled) )
{
info.m_MediaFlags |= eMF_Connected;
}
else
{
info.m_MediaFlags |= eMF_Disconnected;
}
if ( (sourceId == m_SourceId) && (info.m_MediaFlags & (eMF_Disconnected | eMF_Locked | eMF_Loading | eMF_SelectDevice) ) )
{
m_MediaTrackInfo.Clear();
}
}
// Is InitStateGettingState finished?
if (m_InitState == eInitStateGettingState)
{
if( m_SourcesCount == m_Sources.size() )
{
m_InitState = eInitStateGettingMenuLockId;
m_pInitStateTimer->start(CommunicationTimeoutInterval);
GetMenuLockId();
}
}
// Signal the source changes for the current source when in initialized state.
else if (m_InitState == eInitStatePoweredUp)
{
if (sourceId == m_SourceId)
{
emit Source( m_SourceId, info.m_Type, info.m_Name, info.m_Flags );
// And if mediaFlags changed...
if (info.m_MediaFlags != prevMediaFlags)
{
emit Media( m_SourceId,
info.m_MediaFlags,
m_MediaTrackInfo.m_Index,
m_MediaTrackInfo.m_Count,
m_MediaTrackInfo.m_Length,
m_MediaTrackInfo.m_Position );
}
}
// updating sources and we get the last one
if ( ( m_UpdatingAllSources && sourceId == m_SourcesCount - 1 ) || ( !m_UpdatingAllSources && sourceHasChanged ) )
{
m_UpdatingAllSources = false;
emit SourcesListUpdated();
}
}
}
break;
case fapiSourceCount:
{
m_SourcesCount = data.Value< quint8 >();
// Only need to do updates after initialization is complete
if (m_InitState == eInitStatePoweredUp)
{
m_UpdatingAllSources = true;
}
}
break;
case fapiMedia:
{
quint8 sourceId = data.Value< quint8 >();
quint16 flags = data.Value< quint16 >();
quint32 trackNum = data.Value< quint32 >();
quint32 numTracks = data.Value< quint32 >();
quint32 trackLen = data.Value< quint32 >();
quint32 trackPos = data.Value< quint32 >();
//DbgPrintf("fapiMedia: id=%d, flags=%04x, pos=%u", unsigned(sourceId), unsigned(flags), unsigned(trackPos));
m_MediaTrackInfo.m_Index = trackNum;
m_MediaTrackInfo.m_Count = numTracks;
m_MediaTrackInfo.m_Length = trackLen;
m_MediaTrackInfo.m_Position = trackPos;
quint8 sourceFlags = m_Sources.value( sourceId ).m_Flags;
if( ( sourceFlags & eFLSF_Connected ) && ( sourceFlags & eFLSF_Enabled ) )
{
flags |= eMF_Connected;
}
else
{
flags |= eMF_Disconnected;
}
if( m_Sources.contains( sourceId ) == false )
{
m_Sources[ sourceId ] = tSourceInfo( static_cast<quint8>( sourceId ), eST_Invalid, QString(), 0, flags );
}
else
{
m_Sources[ sourceId ].m_MediaFlags = flags;
}
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) && (flags & tFusionClient::eMF_Connected))
{
emit Media( sourceId, flags, trackNum, numTracks, trackLen, trackPos );
}
}
break;
case fapiMediaTrackName:
{
quint8 sourceId = data.Value< quint8 >();
quint32 trackNum = data.Value< quint32 >();
quint8 nameLen = data.Value< quint8 >();
QString name = data.ValueUtf8< QString >( nameLen );
// do not update the track number because it is buggy on some Fusion firmwares except in fapiMedia
m_MediaTrackInfo.m_TrackName = name;
//DbgPrintf( "Media track name received for %d: track %d, name %s ", sourceId, trackNum, qPrintable( name ) );
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) && (GetMediaFlags(m_SourceId) & tFusionClient::eMF_Connected ))
{
emit MediaTrackName( sourceId, trackNum, name );
}
}
break;
case fapiMediaArtistName:
{
quint8 sourceId = data.Value< quint8 >();
quint32 trackNum = data.Value< quint32 >();
quint8 nameLen = data.Value< quint8 >();
QString name = data.ValueUtf8< QString >( nameLen );
// do not update the track number because it is buggy on some Fusion firmwares except in fapiMedia
m_MediaTrackInfo.m_ArtistName = name;
//DbgPrintf( "Media artist name received for %d: track %d, name %s ", sourceId, trackNum, qPrintable( name ) );
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) && (GetMediaFlags(m_SourceId) & tFusionClient::eMF_Connected) )
{
emit MediaArtistName( sourceId, trackNum, name );
}
}
break;
case fapiMediaAlbumName:
{
quint8 sourceId = data.Value< quint8 >();
quint32 trackNum = data.Value< quint32 >();
quint8 nameLen = data.Value< quint8 >();
QString name = data.ValueUtf8< QString >( nameLen );
// do not update the track number because it is buggy on some Fusion firmwares except in fapiMedia
m_MediaTrackInfo.m_AlbumName = name;
//DbgPrintf( "Media album name received for %d: track %d, name %s ", sourceId, trackNum, qPrintable( name ) );
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) && (GetMediaFlags(m_SourceId) & tFusionClient::eMF_Connected) )
{
emit MediaAlbumName( sourceId, trackNum, name );
}
}
break;
case fapiMediaCoverArt:
// not implemented, ignore.
break;
case fapiMediaTrackPos:
{
quint8 sourceId = data.Value< quint8 >();
m_MediaTrackInfo.m_Position = data.Value< quint32 >();
//DbgPrintf( "Media track position received for %d: position %d", sourceId, m_MediaTrackInfo.m_Position );
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) && (GetMediaFlags(m_SourceId) & tFusionClient::eMF_Connected) )
{
emit MediaTrackPos( sourceId, m_MediaTrackInfo.m_Position );
}
}
break;
case fapiMediaLoadingProgress:
{
quint8 sourceId = data.Value< quint8 >();
quint32 progress = data.Value< quint32 >();
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit MediaLoadingProgress( sourceId, progress );
}
}
break;
case fapiMenuAction:
{
quint8 sourceId = data.Value< quint8 >();
quint32 index = data.Value< quint32 >();
eMenuStatus status = ToFusionMenuStatusType( data.Value< quint8 >() );
quint8 lockId = data.Value< quint8 >();
if( lockId == m_MenuLockId )
{
//DbgPrintf( "Menu action received for %d: index %d, status %d", sourceId, index, status );
if( m_SteppingBackToRoot )
{
m_SteppingBackToRoot = false;
if( status == eMS_Closed )
{
// stop the closed message going to UI
// send the open command
SendSetMenuAction( m_SourceId, 0, eFLMA_Open );
return;
}
}
if (m_InitState == eInitStatePoweredUp)
{
emit MenuAction( sourceId, index, status );
}
}
}
break;
case fapiMenuCount:
{
quint8 sourceId = data.Value< quint8 >();
quint32 count = data.Value< quint32 >();
quint8 lockId = data.Value< quint8 >();
if( lockId == m_MenuLockId )
{
//DbgPrintf( "Menu count received for %d: count %d", sourceId, count );
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit MenuItemCount( sourceId, count );
}
}
}
break;
case fapiMenuItem:
{
quint8 sourceId = data.Value< quint8 >();
quint32 index = data.Value< quint32 >();
quint8 flags = data.Value< quint8 >();
quint8 lockId = data.Value< quint8 >();
if( lockId == m_MenuLockId )
{
quint8 nameLen = data.Value< quint8 >();
QString name = data.ValueUtf8< QString >( nameLen );
//DbgPrintf( "Menu item received for %d: index %d, flags %x, name %s", sourceId, index, flags, qPrintable( name ) );
if ( flags & eMIF_Translate )
{
// The translation uses the strings listed in tFusionLinkClient::m_MenuText[].
// If the translation doesn't work, make sure the string has been listed there,
// and that the context string hasn't been changed.
name = QCoreApplication::translate( "Fusion Link menu", name.toUtf8().constData() );
}
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit MenuItem( sourceId, index, flags, name );
}
}
}
break;
case fapiMenuLockId:
{
if ( m_InitState == eInitStateGettingMenuLockId )
{
quint32 seed = data.Value< quint32 >();
quint8 id = data.Value< quint8 >();
if( seed == m_MenuLockSeed )
{
// received our lock id
m_MenuLockId = id;
//DbgPrintf( "Menu lock ID received: id %d", id );
m_InitState = eInitStatePoweredUp;
m_pInitStateTimer->start(CommunicationTimeoutInterval);
// We received fapiPowerState(On) while in eInitStateGettingState,
// but we didn't tell the application, because that still ePS_Booting.
// But now we really are powered up.
UpdatePowerState( ePS_On );
// Signal the source after initialising.
// tMediaBarManager triggers off this to show the right media bar.
// TODO: Really this is a substitute for a missing signal, that should indicate change of initialization state.
const tSourceInfo& info = m_Sources.value( m_SourceId );
emit Source( m_SourceId, info.m_Type, info.m_Name, info.m_Flags );
}
}
}
break;
case fapiAuxGain:
{
quint8 sourceId = data.Value< quint8 >();
qint8 gain = data.Value< qint8 >();
if ( m_Sources.contains( sourceId ) )
{
if ( m_Sources[sourceId].m_AuxGain.UpdateActual(gain) )
{
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit AuxGain( sourceId, gain );
}
}
}
}
break;
case fapiSetting:
{
quint32 id = data.Value< quint32 >();
quint32 value = data.Value< quint32 >();
ProcessFusionLinkSetting( id, value );
}
break;
case fapiSettings:
{
quint32 count = data.Value< quint32 >();
for( quint32 i = 0; i < count; ++i )
{
quint32 id = data.Value< quint32 >();
quint32 value = data.Value< quint32 >();
ProcessFusionLinkSetting( id, value );
}
}
break;
case fapiUpdateFWStatus:
{
quint8 flType = data.Value< quint8 >();
Assert( eFLFT_HeadUnit <= flType && flType <= eFLFT_NRX200 );
quint8 status = data.Value< quint8 >();
quint8 progress = data.Value< quint8 >();
if( status != eFLFS_Uploading )
{
bool success = status == eFLFS_Done;
QString statusString;
switch( status )
{
case eFLFS_Done: statusString = "Done"; break;
case eFLFS_Error: statusString = "Error"; break;
case eFLFS_Invalid: statusString = "Invalid update"; break;
case eFLFS_SettingFailed: statusString = "Setting failed"; break;
default: statusString = "Unknown error"; break;
}
//DbgPrintf( "Update FW status received: success %d, string %s", success, qPrintable( statusString ) );
emit UpdateFirmwareFinished( success, static_cast< eUpdateFirmwareType >( flType ), statusString );
}
else
{
emit UpdateFirmwareProgress( progress );
}
}
break;
case fapiMute:
{
// Convert from tFusionLinkClient::eFusionLinkMuteState to tFusionClient::eState.
switch( data.Value< quint8 >() )
{
case eFLMS_MuteOn:
{
m_Mute = eS_On;
}
break;
case eFLMS_MuteOff:
{
m_Mute = eS_Off;
}
break;
default:
{
m_Mute = eS_Invalid;
}
break;
}
//DbgPrintf( "Mute status received: %d", m_Mute );
if (m_InitState == eInitStatePoweredUp)
{
emit Mute( m_Mute );
}
}
break;
case fapiBalance:
{
quint8 zone = data.Value< quint8 >();
qint8 balance = data.Value< qint8 >();
m_AudioZones[NormalizedZoneIndex(zone)]->UpdateActualBalance(balance);
}
break;
case fapiLowPassFilter:
{
quint8 zone = data.Value< quint8 >();
tFusionAudioZone::eLowPassFilterValue filter = ToLowPassFilterValue(data.Value< quint8 >());
m_AudioZones[NormalizedZoneIndex(zone)]->UpdateActualLowPassFilter(filter);
}
break;
case fapiSubLevels:
{
quint8 zone1SubLevel = data.Value< quint8 >();
quint8 zone2SubLevel = data.Value< quint8 >();
quint8 zone3SubLevel = data.Value< quint8 >();
quint8 zone4SubLevel = data.Value< quint8 >();
// If there is a global subwoofer, its value is in the field for zone 1.
if (m_AudioZones[eFLAZ_Global]->HasSubLevel())
{
m_AudioZones[eFLAZ_Global]->UpdateActualSubLevel(zone1SubLevel);
}
else
{
m_AudioZones[eFLAZ_Zone1]->UpdateActualSubLevel(zone1SubLevel);
m_AudioZones[eFLAZ_Zone2]->UpdateActualSubLevel(zone2SubLevel);
m_AudioZones[eFLAZ_Zone3]->UpdateActualSubLevel(zone3SubLevel);
m_AudioZones[eFLAZ_Zone4]->UpdateActualSubLevel(zone4SubLevel);
}
}
break;
case fapiEq:
{
quint8 zone = data.Value< quint8 >();
qint8 bass = data.Value< qint8 >();
qint8 middle = data.Value< qint8 >();
qint8 treble = data.Value< qint8 >();
eFusionLinkAudioZone zoneIndex = NormalizedZoneIndex(zone);
m_AudioZones[zoneIndex]->UpdateActualBassEqualizer(bass);
m_AudioZones[zoneIndex]->UpdateActualMiddleEqualizer(middle);
m_AudioZones[zoneIndex]->UpdateActualTrebleEqualizer(treble);
}
break;
case fapiVolumeLimits:
{
quint8 zone1VolumeLimit = data.Value< quint8 >();
quint8 zone2VolumeLimit = data.Value< quint8 >();
quint8 zone3VolumeLimit = data.Value< quint8 >();
quint8 zone4VolumeLimit = data.Value< quint8 >();
// If there is a global volume limit, its value is in the field for zone 1.
if (m_AudioZones[eFLAZ_Global]->HasVolumeLimit())
{
m_AudioZones[eFLAZ_Global]->UpdateActualVolumeLimit(zone1VolumeLimit);
}
else
{
m_AudioZones[eFLAZ_Zone1]->UpdateActualVolumeLimit(zone1VolumeLimit);
m_AudioZones[eFLAZ_Zone2]->UpdateActualVolumeLimit(zone2VolumeLimit);
m_AudioZones[eFLAZ_Zone3]->UpdateActualVolumeLimit(zone3VolumeLimit);
m_AudioZones[eFLAZ_Zone4]->UpdateActualVolumeLimit(zone4VolumeLimit);
}
}
break;
case fapiVolumes:
{
quint8 zone1VolumeLevel = data.Value< quint8 >();
quint8 zone2VolumeLevel = data.Value< quint8 >();
quint8 zone3VolumeLevel = data.Value< quint8 >();
quint8 zone4VolumeLevel = data.Value< quint8 >();
// If there is a global volume limit, its value is in the field for zone 1.
if (m_AudioZones[eFLAZ_Global]->HasVolumeLevel())
{
m_AudioZones[eFLAZ_Global]->UpdateActualVolumeLevel(zone1VolumeLevel);
}
else
{
m_AudioZones[eFLAZ_Zone1]->UpdateActualVolumeLevel(zone1VolumeLevel);
m_AudioZones[eFLAZ_Zone2]->UpdateActualVolumeLevel(zone2VolumeLevel);
m_AudioZones[eFLAZ_Zone3]->UpdateActualVolumeLevel(zone3VolumeLevel);
m_AudioZones[eFLAZ_Zone4]->UpdateActualVolumeLevel(zone4VolumeLevel);
}
}
break;
case fapiZoneCapabilities:
{
//TODO_MCB probably should only process fapiZoneCapabilities during initialization and not each time we receive it? Otherwise if zone caps can change, then we should emit some kind of signal.
quint16 zone1Caps = data.Value< quint16 >();
quint16 zone2Caps = data.Value< quint16 >();
quint16 zone3Caps = data.Value< quint16 >();
quint16 zone4Caps = data.Value< quint16 >();
quint16 globalCaps = data.Value< quint16 >();
// Find how many actual zones are implemented in the server
// by looking for non-zero Caps.
// Don't allow 'holes' - if zone n is not implemented,
// then zone n+1 should also be not (because we assume index
// in m_AudioZones is same index on server).
if (zone1Caps == 0)
{
m_ZoneCount = 0;
}
else if (zone2Caps == 0)
{
m_ZoneCount = 1;
}
else if (zone3Caps == 0)
{
m_ZoneCount = 2;
}
else if (zone4Caps == 0)
{
m_ZoneCount = 3;
}
else
{
m_ZoneCount = 4;
}
m_hasGlobalZone = (globalCaps != 0);
// Update the audio zones.
m_AudioZones[eFLAZ_Zone1] ->UpdateZoneCapabilities(zone1Caps);
m_AudioZones[eFLAZ_Zone2] ->UpdateZoneCapabilities(zone2Caps);
m_AudioZones[eFLAZ_Zone3] ->UpdateZoneCapabilities(zone3Caps);
m_AudioZones[eFLAZ_Zone4] ->UpdateZoneCapabilities(zone4Caps);
m_AudioZones[eFLAZ_Global]->UpdateZoneCapabilities(globalCaps);
}
break;
case fapiPowerState:
{
eFusionLinkPowerState FLPowerState = static_cast< eFusionLinkPowerState >( data.Value< quint8 >() );
if (FLPowerState == eFLPS_Off)
{
// The server can send fapiPowerState(Off) while it is booting up (i.e. powering on).
// Eventually it will send fapiPowerState(On), and we should ignore the off for now.
if (m_InitState != eInitStatePoweringOn)
{
m_InitState = eInitStatePoweredDown;
m_pInitStateTimer->stop();
UpdatePowerState(ePS_Off);
}
}
else if (FLPowerState == eFLPS_On)
{
switch (m_InitState)
{
case eInitStatePoweredDown:
case eInitStatePoweringOn:
m_InitState = eInitStateGettingState;
m_pInitStateTimer->start(GettingStateTimeoutInterval);
SendGetState();
break;
case eInitStateGettingState:
UpdatePowerState(ePS_Booting);
break;
default:
// We already know it is on.
break;
}
}
}
break;
case fapiZoneName:
{
quint8 zone = data.Value< quint8 >();
quint8 length = data.Value< quint8 >();
QString name = data.ValueUtf8< QString >( length );
m_AudioZones[NormalizedZoneIndex(zone)]->UpdateActualZoneName(name);
}
break;
case fapiTuner:
{
// TODO_MCB why don't we store this state? probably assuming that it will be resent often.
quint8 sourceId = data.Value< quint8 >();
eTunerStatus status = static_cast< eTunerStatus >( data.Value< quint8 >() );
Assert( eTS_Scanning <= status && status <= eTS_NotScanning );
quint32 frequency = data.Value< quint32 >();
quint8 signalStrength = data.Value< quint8 >();
quint8 rdsLen = data.Value< quint8 >();
QString rds = data.ValueUtf8< QString >( rdsLen );
//DbgPrintf( "Tuner msg received for %d: status %d, freq %d, strength %d, rds %s", sourceId, status, frequency, signalStrength, qPrintable( rds ) );
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit Tuner( sourceId, status, frequency, signalStrength, rds );
}
}
break;
case fapiMarineTuner:
{
// TODO_MCB why don't we store this state? probably assuming that it will be resent often.
quint8 sourceId = data.Value< quint8 >();
quint8 channel = data.Value< quint8 >();
quint8 signalStrength = data.Value< quint8 >();
quint8 nameLen = data.Value< quint8 >();
QString name = data.ValueUtf8< QString >( nameLen );
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit MarineTuner( sourceId, channel, signalStrength, name );
}
}
break;
case fapiMarineSquelch:
{
quint8 sourceId = data.Value< quint8 >();
quint8 squelch = data.Value< quint8 >();
if ( m_Sources.contains( sourceId ) )
{
if ( m_Sources[sourceId].m_MarineSquelch.UpdateActual(squelch) )
{
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit MarineSquelch( sourceId, squelch );
}
}
}
}
break;
case fapiMarineScanMode:
{
quint8 sourceId = data.Value< quint8 >();
switch( data.Value< quint8 >() )
{
case eFLMSS_EnableScan:
m_ScanOn = eS_On;
break;
case eFLMSS_DisableScan:
m_ScanOn = eS_Off;
break;
default:
m_ScanOn = eS_Invalid;
break;
}
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit MarineScanMode( sourceId, m_ScanOn );
}
}
break;
case fapiDvd:
{
quint8 sourceId = data.Value< quint8 >();
tFusionClient::eDVDPowerState powerState = eDPS_Off;
switch( data.Value< quint8 >() )
{
case eFLDPS_On:
powerState = eDPS_On;
break;
case eFLDPS_Off:
powerState = eDPS_Off;
break;
default:
powerState = eDPS_Off;
break;
}
tFusionClient::eDVDDiskState diskState = ToDiskState( data.Value< quint8 >() );
tFusionClient::eDVDPlayState playState = ToPlayState( data.Value< quint8 >() );
tFusionClient::eDVDRepeatState repeatState = ToDVDRepeatState( data.Value< quint8 >() );
tFusionClient::eDVDShuffleState shuffleState = ToDVDShuffleState( data.Value< quint8 >() );
m_DvdInfo.m_PowerState = powerState;
m_DvdInfo.m_DiskState = diskState;
m_DvdInfo.m_PlayState = playState;
m_DvdInfo.m_RepeatState = repeatState;
m_DvdInfo.m_ShuffleState = shuffleState;
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit DVD( sourceId, powerState, diskState, playState, repeatState, shuffleState );
}
}
break;
case fapiDvdTrack:
{
quint8 sourceId = data.Value< quint8 >();
quint16 track = data.Value< quint16 >();
quint8 titleNumber = data.Value< quint8 >();
quint16 trackCount = data.Value< quint16 >();
quint16 trackLength = data.Value< quint16 >();
m_DvdInfo.m_TrackNum = track;
m_DvdInfo.m_TitleNum = titleNumber;
m_DvdInfo.m_NumTracks = trackCount;
m_DvdInfo.m_Length = trackLength;
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit DVDTrack( sourceId, track, titleNumber, trackCount, trackLength );
}
}
break;
case fapiDvdTrackPosition:
{
quint8 sourceId = data.Value< quint8 >();
quint32 position = data.Value< quint32 >();
m_DvdInfo.m_Position = position;
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit DVDTrackPos( sourceId, position );
}
}
break;
case fapiDvdTrackName:
{
quint8 sourceId = data.Value< quint8 >();
quint8 nameLen = data.Value< quint8 >();
QString name = data.ValueUtf8< QString >( nameLen );
m_DvdInfo.m_TrackName = name;
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit DVDTrackName( sourceId, name );
}
}
break;
case fapiDvdArtistName:
{
quint8 sourceId = data.Value< quint8 >();
quint8 nameLen = data.Value< quint8 >();
QString name = data.ValueUtf8< QString >( nameLen );
m_DvdInfo.m_ArtistName = name;
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() && (sourceId == m_SourceId) )
{
emit DVDArtistName( sourceId, name );
}
}
break;
default:
//DbgPrintf( "Data received with command %x, which is not implemented", command );
break;
}
}
}
//-----------------------------------------------------------------------------
//! private slot
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendData( const tFusionData& data )
{
// TODO: figure out which transport to use
if( m_pNmea2kTransport )
{
return m_pNmea2kTransport->SendData( data );
}
return false;
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::SendGetState()
{
tFusionData data( 2 );
data.AddValue< quint16 >( fapiGetState );
SendData( data );
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::GetMenuLockId()
{
tFusionData data( 6 );
data.AddValue< quint16 >( fapiGetMenuLockId );
m_MenuLockSeed = static_cast< quint32 >( tRand::Integer() );
data.AddValue< quint32 >( m_MenuLockSeed );
SendData( data );
}
//-----------------------------------------------------------------------------
//! Sends fapiSetSetting command to server.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendSetSetting( eFusionLinkSettingId id, quint32 value )
{
tFusionData data( 10 );
data.AddValue< quint16 >( fapiSetSetting );
data.AddValue< quint32 >( static_cast< quint32 >( id ) );
data.AddValue< quint32 >( value );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! Send fapiResetSettings.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SendResetSettings()
{
tFusionData data( 2 );
data.AddValue< quint16 >( fapiResetSettings );
return SendData( data );
}
//-----------------------------------------------------------------------------
//! Slot to factory reset server.
//-----------------------------------------------------------------------------
void tFusionLinkClient::FactoryResetServer()
{
SendResetSettings();
}
//! Implement tFusionClient::SendSetZoneEnabled() for FusionLink.
//! Calls SendSetSetting as appropriate.
void tFusionLinkClient::SendSetZoneEnabled(quint8 zoneIndex, bool zoneEnabled)
{
quint32 settingValue = zoneEnabled ? tFusionLinkClient::eFLZE_Enable : tFusionLinkClient::eFLZE_Disable;
switch (zoneIndex)
{
case eFLAZ_Zone2: SendSetSetting(eFLSI_Zone2Enabled, settingValue); break;
case eFLAZ_Zone3: SendSetSetting(eFLSI_Zone3Enabled, settingValue); break;
case eFLAZ_Zone4: SendSetSetting(eFLSI_Zone4Enabled, settingValue); break;
default: Assert(false); break;
}
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnAlphaSearchClicked( int value )
{
eFusionLinkAlphaSearchThreshold setting = eFusionLinkAlphaSearchThreshold( value );
Assert( eFLAST_Off <= setting && setting <= eFLAST_800 );
if( setting <= eFLAST_800 )
{
SendSetSetting( eFLSI_AlphaSearchThreshold, setting );
return;
}
Assert(false);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
bool tFusionLinkClient::SetZone2LinkedToZone1( bool linked )
{
return SendSetSetting( eFLSI_Zone2Linked, linked );
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnIpodSubtitlesClicked( int value )
{
eFusionLinkIpodSubtitles setting = eFusionLinkIpodSubtitles( value );
Assert( eFLIS_Off <= setting && setting <= eFLIS_ClosedCaptionsOn );
if( setting <= eFLIS_ClosedCaptionsOn )
{
SendSetSetting( eFLSI_IpodSubtitles, setting );
return;
}
Assert(false);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnTelemuteClicked( int value )
{
eFusionLinkTelemute setting = eFusionLinkTelemute( value );
Assert( eFLTM_Mute <= setting && setting <= eFLTM_Aux );
if( setting <= eFLTM_Aux )
{
SendSetSetting( eFLSI_Telemute, setting );
return;
}
Assert(false);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnIpodAlbumArtworkClicked( int value )
{
eFusionLinkIpodAlbumArtwork setting = eFusionLinkIpodAlbumArtwork( value );
Assert( eFLIAA_Enable <= setting && setting <= eFLIAA_Disable );
if( setting <= eFLIAA_Disable )
{
SendSetSetting( eFLSI_IpodAlbumArtwork, setting );
return;
}
Assert(false);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnIpodVideoSignalClicked( int value )
{
eFusionLinkIpodVideoSignal setting = eFusionLinkIpodVideoSignal( value );
Assert( eFLIVS_NTSC <= setting && setting <= eFLIVS_Pal );
if( setting <= eFLIVS_Pal )
{
SendSetSetting( eFLSI_IpodVideoSignal, setting );
return;
}
Assert(false);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnIpodMonitorAspectClicked( int value )
{
eFusionLinkIpodMonitorAspect setting = eFusionLinkIpodMonitorAspect( value );
Assert( eFLIMA_4_3 <= setting && setting <= eFLIMA_16_9 );
if( setting <= eFLIMA_16_9 )
{
SendSetSetting( eFLSI_IpodMonitorAspect, setting );
return;
}
Assert(false);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnAuxNameIndexClicked( int value )
{
eFusionLinkAuxNameIndex setting = eFusionLinkAuxNameIndex( value );
Assert( eFLANI_Aux <= setting && setting <= eFLANI_MS_BT100 );
if( setting <= eFLANI_MS_BT100 )
{
SendSetSetting( eFLSI_AuxNameIndex, setting );
return;
}
Assert(false);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnAmEnabledClicked( int value )
{
eFusionLinkAmEnabled setting = eFusionLinkAmEnabled( value );
Assert( eFLAE_Disable <= setting && setting <= eFLAE_Enable );
if( setting <= eFLAE_Enable )
{
SendSetSetting( eFLSI_AmEnabled, setting );
return;
}
Assert(false);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnVhfEnabledClicked( int value )
{
eFusionLinkVhfEnabled setting = eFusionLinkVhfEnabled( value );
Assert( eFLVE_Disable <= setting && setting <= eFLVE_Enable );
if( setting <= eFLVE_Enable )
{
SendSetSetting( eFLSI_VhfEnabled, setting );
return;
}
Assert(false);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnInternalAmpsEnabledClicked( int value )
{
eFusionLinkInternalAmpsEnabled setting = eFusionLinkInternalAmpsEnabled( value );
Assert( eFLIAE_Disabled <= setting && setting <= eFLIAE_Enabled );
if( setting <= eFLIAE_Enabled )
{
SendSetSetting( eFLSI_InternalAmpsEnabled, setting );
return;
}
Assert(false);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnAccessorySourceClicked( int value )
{
eFusionLinkAccessorySource setting = eFusionLinkAccessorySource( value );
Assert( eFLAS_Sirius <= setting && setting <= eFLAS_Bluetooth);
if( setting <= eFLAS_Bluetooth )
{
SendSetSetting( eFLSI_AccessorySource, setting );
return;
}
Assert(false);
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::ProcessFusionLinkSetting( quint32 id, quint32 value )
{
// For debugging and can convert to actual code soon.
//QMap<quint32, const char*> settingNames;
//settingNames[ 0] = ("ALPHA_SEARCH_THRESHOLD");
//settingNames[ 1] = ("IPOD_SUBTITLES");
//settingNames[ 2] = ("ZONE2_LINKED");
//settingNames[ 3] = ("ZONE2_ENABLED");
//settingNames[ 4] = ("ZONE3_ENABLED");
//settingNames[ 5] = ("ZONE4_ENABLED");
//settingNames[ 6] = ("TELEMUTE");
//settingNames[ 7] = ("TUNER_REGION");
//settingNames[ 8] = ("MARINE_ZONE");
//settingNames[ 9] = ("USB_REPEAT");
//settingNames[10] = ("USB_SHUFFLE");
//settingNames[11] = ("IPOD_ALBUM_ARTWORK");
//settingNames[12] = ("IPOD_REPEAT");
//settingNames[13] = ("IPOD_SHUFFLE");
//settingNames[14] = ("AM_PRESET_0");
//settingNames[28] = ("AM_PRESET_14");
//settingNames[29] = ("FM_PRESET_0");
//settingNames[43] = ("FM_PRESET_14");
//settingNames[44] = ("MARINE_PRESET_0");
//settingNames[58] = ("MARINE_PRESET_14");
//settingNames[59] = ("CLOCK_TIME");
//settingNames[60] = ("CLOCK_ALARM");
//settingNames[61] = ("IPOD_VIDEO_SIGNAL");
//settingNames[62] = ("IPOD_MONITOR_ASPECT");
//settingNames[63] = ("AUX_NAME_INDEX");
//settingNames[64] = ("AM_ENABLED");
//settingNames[65] = ("VHF_ENABLED");
//settingNames[66] = ("LANGUAGE");
//settingNames[67] = ("INTERNAL_AMPS_ENABLED");
//settingNames[68] = ("MTP_REPEAT");
//settingNames[69] = ("MTP_SHUFFLE");
//settingNames[70] = ("ACCESSORY_SOURCE");
//DbgPrintf( "%6u: %8u %s", id, value, settingNames.value(id, ""));
if ( (id >= eFLSI_AMPreset0) && (id <= eFLSI_AMPreset14) )
{
uint presetIndex = id - eFLSI_AMPreset0;
if( value != m_AMPresets[presetIndex] )
{
m_AMPresets[presetIndex] = value;
emit AMFavoritesChanged();
}
}
else if ( (id >= eFLSI_FMPreset0) && (id <= eFLSI_FMPreset14) )
{
uint presetIndex = id - eFLSI_FMPreset0;
if( value != m_FMPresets[presetIndex] )
{
m_FMPresets[presetIndex] = value;
emit FMFavoritesChanged();
}
}
else if ( (id >= eFLSI_VHFPreset0) && (id <= eFLSI_VHFPreset14) )
{
uint presetIndex = id - eFLSI_VHFPreset0;
if( value != m_VHFPresets[presetIndex] )
{
m_VHFPresets[presetIndex] = value;
emit VHFFavoritesChanged();
}
}
else
{
switch( id )
{
case eFLSI_AlphaSearchThreshold:
{
Assert( value <= eFLAST_800 );
m_AlphaSearchThreshold = eFusionLinkAlphaSearchThreshold( value );
}
break;
case eFLSI_IpodSubtitles:
{
Assert( value <= eFLIS_ClosedCaptionsOn );
m_IpodSubtitles = eFusionLinkIpodSubtitles( value );
}
break;
case eFLSI_Zone2Linked:
{
Assert( value <= eFLZ2L_Linked );
m_HasZone2Linked = true;
bool linked = ( value == eFLZ2L_Linked );
if ( m_Zone2Linked != linked )
{
m_Zone2Linked = linked;
emit Zone2LinkedToZone1Changed( m_Zone2Linked );
}
}
break;
case eFLSI_Zone2Enabled:
Assert( value <= eFLZE_Enable );
m_AudioZones[eFLAZ_Zone2]->UpdateActualZoneEnabled(value == eFLZE_Enable);
break;
case eFLSI_Zone3Enabled:
Assert( value <= eFLZE_Enable );
m_AudioZones[eFLAZ_Zone3]->UpdateActualZoneEnabled(value == eFLZE_Enable);
break;
case eFLSI_Zone4Enabled:
Assert( value <= eFLZE_Enable );
m_AudioZones[eFLAZ_Zone4]->UpdateActualZoneEnabled(value == eFLZE_Enable);
break;
case eFLSI_Telemute:
{
Assert( value <= eFLTM_Aux );
m_Telemute = eFusionLinkTelemute( value );
}
break;
case eFLSI_SelectTunerRegion:
{
Assert( value <= eFLTR_Australasia );
m_TunerRegion = ToTunerRegion( value );
emit TunerRegion( m_TunerRegion );
}
break;
case eFLSI_SelectMarineRegion:
{
Assert( value <= eFLMR_International );
m_MarineRegion = ToMarineRegion( value );
emit MarineRegion( m_MarineRegion );
}
break;
case eFLSI_UsbRepeat:
ProcessSettingUsbRepeat(value);
break;
case eFLSI_UsbShuffle:
ProcessSettingUsbShuffle(value);
break;
case eFLSI_IpodAlbumArtwork:
{
Assert( value <= eFLIAA_Disable );
m_IpodAlbumArtwork = eFusionLinkIpodAlbumArtwork( value );
}
break;
case eFLSI_IpodRepeat:
ProcessSettingIpodRepeat(value);
break;
case eFLSI_IpodShuffle:
ProcessSettingIpodShuffle(value);
break;
case eFLSI_IpodVideoSignal:
{
Assert( value <= eFLIVS_Pal );
m_IpodVideoSignal = eFusionLinkIpodVideoSignal( value );
}
break;
case eFLSI_IpodMonitorAspect:
{
Assert( value <= eFLIMA_16_9 );
m_IpodMonitorAspect = eFusionLinkIpodMonitorAspect( value );
}
break;
case eFLSI_AuxNameIndex:
{
Assert( value <= eFLANI_MS_BT100 );
m_AuxNameIndex = eFusionLinkAuxNameIndex( value );
UpdateAuxSourceName();
emit AuxNameChanged();
}
break;
case eFLSI_AmEnabled:
{
Assert( value <= eFLAE_Enable );
m_AmEnabled = eFusionLinkAmEnabled( value );
}
break;
case eFLSI_VhfEnabled:
{
Assert( value <= eFLVE_Enable );
m_VhfEnabled = eFusionLinkVhfEnabled( value );
}
break;
case eFLSI_InternalAmpsEnabled:
{
Assert( value <= eFLIAA_Disable );
m_InternalAmpsEnabled = eFusionLinkInternalAmpsEnabled( value );
}
break;
case eFLSI_MtpRepeat:
ProcessSettingMtpRepeat(value);
break;
case eFLSI_MtpShuffle:
ProcessSettingMtpShuffle(value);
break;
case eFLSI_AccessorySource:
{
Assert( value <= eFLIAA_Disable );
m_AccessorySource = eFusionLinkAccessorySource( value );
}
break;
default:
//DbgPrintf( "Unknown setting %d skipped: value %d", id, value );
break;
}
}
}
//-----------------------------------------------------------------------------
//! Process fapiSetting(SETTING_ID_USB_REPEAT) to call UpdateRepeatMode().
//-----------------------------------------------------------------------------
void tFusionLinkClient::ProcessSettingUsbRepeat( quint32 value )
{
eRepeatMode previousUsbRepeatMode = m_UsbRepeatMode;
switch(value)
{
case eFLUsbRepeatOff: m_UsbRepeatMode = eRM_RepeatOff; break;
case eFLUsbRepeatFolder: m_UsbRepeatMode = eRM_RepeatFolder; break;
default: Assert(false); break;
}
if (m_UsbRepeatMode != previousUsbRepeatMode)
{
EmitRepeatModeForSourceType( eST_USB, m_UsbRepeatMode );
}
}
//-----------------------------------------------------------------------------
//! Process fapiSetting(SETTING_ID_USB_SHUFFLE) to call UpdateShuffleMode().
//-----------------------------------------------------------------------------
void tFusionLinkClient::ProcessSettingUsbShuffle( quint32 value )
{
eShuffleMode previousUsbShuffleMode = m_UsbShuffleMode;
switch(value)
{
case eFLUsbShuffleOff: m_UsbShuffleMode = eSM_ShuffleOff; break;
case eFLUsbShuffleAll: m_UsbShuffleMode = eSM_ShuffleAll; break;
default: Assert(false); break;
}
if (m_UsbShuffleMode != previousUsbShuffleMode)
{
EmitShuffleModeForSourceType( eST_USB, m_UsbShuffleMode );
}
}
//-----------------------------------------------------------------------------
//! Process fapiSetting(SETTING_ID_IPOD_REPEAT) to call UpdateRepeatMode().
//-----------------------------------------------------------------------------
void tFusionLinkClient::ProcessSettingIpodRepeat( quint32 value )
{
eRepeatMode previousIpodRepeatMode = m_IpodRepeatMode;
switch(value)
{
case eFLIpodRepeatOff: m_IpodRepeatMode = eRM_RepeatOff; break;
case eFLIpodRepeatOne: m_IpodRepeatMode = eRM_RepeatOne; break;
case eFLIpodRepeatAll: m_IpodRepeatMode = eRM_RepeatAll; break;
default: Assert(false); break;
}
if (m_IpodRepeatMode != previousIpodRepeatMode)
{
EmitRepeatModeForSourceType( eST_Ipod, m_IpodRepeatMode );
}
}
//-----------------------------------------------------------------------------
//! Process fapiSetting(SETTING_ID_IPOD_SHUFFLE) to call UpdateShuffleMode().
//-----------------------------------------------------------------------------
void tFusionLinkClient::ProcessSettingIpodShuffle( quint32 value )
{
eShuffleMode previousIpodShuffleMode = m_IpodShuffleMode;
switch(value)
{
case eFLIpodShuffleOff: m_IpodShuffleMode = eSM_ShuffleOff; break;
case eFLIpodShuffleTracks: m_IpodShuffleMode = eSM_ShuffleTracks; break;
case eFLIpodShuffleAlbums: m_IpodShuffleMode = eSM_ShuffleAlbums; break;
default: Assert(false); break;
}
if (m_IpodShuffleMode != previousIpodShuffleMode)
{
EmitShuffleModeForSourceType( eST_Ipod, m_IpodShuffleMode );
}
}
//-----------------------------------------------------------------------------
//! Process fapiSetting(SETTING_ID_MTP_REPEAT) to call UpdateRepeatMode().
//-----------------------------------------------------------------------------
void tFusionLinkClient::ProcessSettingMtpRepeat( quint32 value )
{
eRepeatMode previousMtpRepeatMode = m_MtpRepeatMode;
switch(value)
{
case eFLMtpRepeatOff: m_MtpRepeatMode = eRM_RepeatOff; break;
case eFLMtpRepeatFolder: m_MtpRepeatMode = eRM_RepeatFolder; break;
default: Assert(false); break;
}
if (m_MtpRepeatMode != previousMtpRepeatMode)
{
EmitRepeatModeForSourceType( eST_MTP, m_MtpRepeatMode );
}
}
//-----------------------------------------------------------------------------
//! Process fapiSetting(SETTING_ID_MTP_SHUFFLE) to call UpdateShuffleMode().
//-----------------------------------------------------------------------------
void tFusionLinkClient::ProcessSettingMtpShuffle( quint32 value )
{
eShuffleMode previousMtpShuffleMode = m_MtpShuffleMode;
switch(value)
{
case eFLMtpShuffleOff: m_MtpShuffleMode = eSM_ShuffleOff; break;
case eFLMtpShuffleAll: m_MtpShuffleMode = eSM_ShuffleAll; break;
default: Assert(false); break;
}
if (m_MtpShuffleMode != previousMtpShuffleMode)
{
EmitShuffleModeForSourceType( eST_MTP, m_MtpShuffleMode );
}
}
//-----------------------------------------------------------------------------
//! Emit RepeatMode(repeatMode) signal for the current source if it is of the given sourceType.
//-----------------------------------------------------------------------------
void tFusionLinkClient::EmitRepeatModeForSourceType( eSourceType sourceType, eRepeatMode repeatMode )
{
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() )
{
foreach( tSourceInfo info, m_Sources.values() )
{
if ( (info.m_Type == sourceType) && (info.m_SourceId == m_SourceId) )
{
emit RepeatMode(info.m_SourceId, repeatMode);
}
}
}
}
//-----------------------------------------------------------------------------
//! Emit ShuffleMode(shuffleMode) signal for the current source if it is of the given sourceType.
//-----------------------------------------------------------------------------
void tFusionLinkClient::EmitShuffleModeForSourceType( eSourceType sourceType, eShuffleMode shuffleMode )
{
// Only emit if initialized and appropriate for current source.
if ( IsOnAndInitialized() )
{
foreach( tSourceInfo info, m_Sources.values() )
{
if ( (info.m_Type == sourceType) && (info.m_SourceId == m_SourceId) )
{
emit ShuffleMode(info.m_SourceId, shuffleMode);
}
}
}
}
//-----------------------------------------------------------------------------
//! Convert from protocol byte value to abstract enum.
//-----------------------------------------------------------------------------
tFusionClient::eSourceType tFusionLinkClient::ToFusionSourceType( quint8 type ) const
{
switch( type )
{
case eFLST_AM: return eST_AM;
case eFLST_FM: return eST_FM;
case eFLST_Aux: return eST_Aux;
case eFLST_Sirius: return eST_Sirius;
case eFLST_iPod: return eST_Ipod;
case eFLST_Storage: return eST_USB;
case eFLST_DVD: return eST_DVD;
case eFLST_VHF: return eST_VHF;
case eFLST_MTP: return eST_MTP;
case eFLST_Bluetooth: return eST_Bluetooth;
default: return eST_Unknown;
};
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
tFusionClient::eTunerRegion tFusionLinkClient::ToTunerRegion( const quint32 value ) const
{
switch( value )
{
case eFLTR_USA: return eTR_USA;
case eFLTR_Europe: return eTR_Europe;
case eFLTR_Japan: return eTR_Japan;
case eFLTR_Australasia: return eTR_Australasia;
default: return eTR_Unknown;
}
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
tFusionClient::eMarineRegion tFusionLinkClient::ToMarineRegion( const quint32 value ) const
{
switch( value )
{
case eFLMR_USA: return eMR_USA;
case eFLMR_Canada: return eMR_Canada;
case eFLMR_International: return eMR_International;
default: return eMR_Unknown;
}
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
tFusionClient::eMenuStatus tFusionLinkClient::ToFusionMenuStatusType( quint8 type ) const
{
switch( type )
{
case eFLMS_RootOpened: return eMS_OpenedRoot;
case eFLMS_SubOpened: return eMS_Opened;
case eFLMS_ItemUpdated: return eMS_ItemUpdated;
case eFLMS_Closed: return eMS_Closed;
case eFLMS_Locked: return eMS_Locked;
default: Assert(false); return eMS_Unknown;
};
}
//-----------------------------------------------------------------------------
//! Convert from protocol byte value to abstract enum.
//-----------------------------------------------------------------------------
tFusionAudioZone::eLowPassFilterValue tFusionLinkClient::ToLowPassFilterValue( quint8 filter ) const
{
switch( filter )
{
case eFLLPFV_55Hz: return tFusionAudioZone::eLPFV_55Hz;
case eFLLPFV_85Hz: return tFusionAudioZone::eLPFV_85Hz;
case eFLLPFV_120Hz: return tFusionAudioZone::eLPFV_120Hz;
case eFLLPFV_160Hz: return tFusionAudioZone::eLPFV_160Hz;
default: Assert(false); return tFusionAudioZone::eLPFV_55Hz; // Return an arbitrary value.
};
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
tFusionLinkClient::eDVDDiskState tFusionLinkClient::ToDiskState( const quint8 value )
{
switch( value)
{
case eFLDDS_None: return eDDS_None;
break;
case eFLDDS_Ejecting: return eDDS_Ejecting;
break;
case eFLDDS_Inserting: return eDDS_Inserting;
break;
case eFLDDS_Loading: return eDDS_Loading;
break;
case eFLDDS_Error: return eDDS_Error;
break;
case eFLDDS_CDDA: return eDDS_CDDA;
break;
case eFLDDS_MP3: return eDDS_MP3;
break;
case eFLDDS_VCD: return eDDS_VCD;
break;
case eFLDDS_SVCD: return eDDS_SVCD;
break;
case eFLDDS_DVD: return eDDS_DVD;
break;
case eFLDDS_Other: return eDDS_Other;
break;
default:
break;
}
return eDDS_None;
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
tFusionLinkClient::eDVDPlayState tFusionLinkClient::ToPlayState( const quint8 value )
{
switch( value )
{
case eFLDPS_Invalid: return eDPS_Invalid;
break;
case eFLDPS_Playing: return eDPS_Playing;
break;
case eFLDPS_Paused: return eDPS_Paused;
break;
case eFLDPS_Stopped: return eDPS_Stopped;
break;
case eFLDSP_SkipForward: return eDSP_SkipForward;
break;
case eFLDSP_SkipRewind: return eDSP_SkipRewind;
break;
default:
break;
}
return eDPS_Invalid;
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
tFusionLinkClient::eDVDRepeatState tFusionLinkClient::ToDVDRepeatState( const quint8 value )
{
switch( value )
{
case eFLDRS_Off: return eDRS_Off;
break;
case eFLDRS_One: return eDRS_One;
break;
case eFLDRS_All: return eDRS_All;
break;
case eFLDRS_Dir: return eDRS_Dir;
break;
case eFLDRS_Title: return eDRS_Title;
break;
case eFLDRS_Chapter: return eDRS_Chapter;
break;
case eFLDRS_Unknown: return eDRS_Unknown;
break;
default:
break;
}
return eDRS_Unknown;
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
tFusionLinkClient::eDVDShuffleState tFusionLinkClient::ToDVDShuffleState( const quint8 value )
{
switch( value )
{
case eFLDSS_Off: return eDSS_Off;
break;
case eFLDDS_On: return eDDS_On;
break;
default:
break;
}
return eDSS_Off;
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
QString tFusionLinkClient::GetAuxName()
{
return GetAuxName( m_AuxNameIndex );
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
QString tFusionLinkClient::GetAuxName( eFusionLinkAuxNameIndex index )
{
switch( index )
{
case eFLANI_Aux:
return tr( "Aux" );
case eFLANI_TV:
return tr( "TV" );
case eFLANI_DVD:
return tr( "DVD" );
case eFLANI_Game:
return tr( "Game" );
case eFLANI_Portable:
return tr( "Portable" );
case eFLANI_Computer:
return tr( "Computer" );
case eFLANI_MS_BT100:
return tr( "MS-BT100" );
}
return QString("AUX");
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tFusionLinkClient::UpdateAuxSourceName()
{
QMap< quint16, tSourceInfo >::Iterator it = m_Sources.begin();
while ( it != m_Sources.end() )
{
if ( it->m_Type == tFusionClient::eST_Aux )
{
it->m_Name = GetAuxName();
}
++it;
}
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
QList<uint> tFusionLinkClient::ActiveFavorites( const QVector<quint32> &favorites ) const
{
QList< uint > result;
foreach( const quint32 &favorite, favorites)
{
if (favorite != 0)
{
result << favorite;
}
}
qSort(result);
return result;
}
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
uint tFusionLinkClient::FirstFreeFavorite( const QVector<quint32> &favorites )
{
int index = favorites.indexOf( 0 );
return index == -1 ? cMaxFavorites : index;
}
//-----------------------------------------------------------------------------
//! Implementation of tINDP2kDeviceFirmwareUpgrader::CanUpgradeDeviceFirmware for Fusion Link Client.
//!
//! True if pDevice represents the server this client is communicating with.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::CanUpgradeDeviceFirmware( tNDP2kDevice * pDevice ) const
{
if( m_pNmea2kTransport )
{
return m_pNmea2kTransport->IsTransportFor( pDevice );
}
else
{
Assert( false );
return false;
}
}
//-----------------------------------------------------------------------------
//! Implementation of tINDP2kDeviceFirmwareUpgrader::UpgradeDeviceFirmware for Fusion Link Client.
//!
//! Send the command to start a firmware update.
//-----------------------------------------------------------------------------
bool tFusionLinkClient::UpgradeDeviceFirmware( tNDP2kDevice* pDevice )
{
if ( pDevice )
{
return SendUpdateFirmware(eFLFT_HeadUnit);
}
else
{
Assert( false );
return false;
}
}
//-----------------------------------------------------------------------------
//! Update our cache of the current power state.
//! Signals only if changed.
//-----------------------------------------------------------------------------
void tFusionLinkClient::UpdatePowerState( ePowerState powerState)
{
//DbgPrintf( "Power state: %d", m_PowerState );
if ( m_PowerState != powerState)
{
m_PowerState = powerState;
emit PowerStateChanged( m_PowerState );
}
}
//-----------------------------------------------------------------------------
//!< Called by timeout on m_InitStateTimer.
//-----------------------------------------------------------------------------
void tFusionLinkClient::OnInitStateTimerTimeout()
{
GoToInitStateProbingPowerState();
}
//-----------------------------------------------------------------------------
//! Reset initialization state to find and begin new connection.
//-----------------------------------------------------------------------------
void tFusionLinkClient::GoToInitStateProbingPowerState()
{
bool wasConnected = (m_PowerState != ePS_Invalid);
m_InitState = eInitStateGettingState;
m_pInitStateTimer->start(GettingStateTimeoutInterval);
SendGetState();
// Reset significant cached state.
m_SourceId = static_cast<unsigned char>( cFusionInvalidSourceId );
ResetZoneSetting();
UpdatePowerState( ePS_Invalid );
m_SteppingBackToRoot = false;
if (wasConnected)
{
// send a signal to notify the UI the state change
emit Source(cFusionInvalidSourceId, eST_Invalid, QString(), 0);
emit ServerDisconnected();
}
}
//-----------------------------------------------------------------------------
//! Normalize the value from the zone field of a received server command to use as index into m_AudioZones.
//! Either a valid zone, or the global zone.
//-----------------------------------------------------------------------------
tFusionLinkClient::eFusionLinkAudioZone tFusionLinkClient::NormalizedZoneIndex(quint8 zone) const
{
if (zone < m_ZoneCount)
{
return static_cast<eFusionLinkAudioZone>(zone);
}
else
{
return eFLAZ_Global;
}
}
|
56e61b0948b1470f673d7a314681dedae316d6b4 | ccfbf5a9ee9c00282c200945bbe36b387eb38b19 | /Codeforces Solutions/codeforces 149D.cpp | ce1a48ce611c95d9dd413d8bd9af71a39a09ba79 | [] | no_license | sakiib/OnlineJudge-Solutions | e070d4b255d036cdefaf087e9f75b69db708406c | b024352aa99efe548b48ef74c492cb69c1fa89f9 | refs/heads/master | 2023-01-07T20:57:04.259395 | 2020-11-16T08:41:27 | 2020-11-16T08:41:27 | 288,191,980 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,042 | cpp | codeforces 149D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
typedef unsigned long long uLL;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 100005;
const int MOD = 1e9+7;
const double EPS = 1e-6;
const double PI = acos(-1.0);
#define FOR1(i,a,b) for(int i=a; i<=b ;i++)
#define FOR0(i,a) for(int i=0; i<a ;i++)
#define CLR(a,n) FOR0(i,n) a[i].clear()
#define MEM(a,x) memset(a, x ,sizeof(a))
#define scanI(a) scanf("%d",&a)
#define scanI2(a,b) scanI(a), scanI(b)
#define scanI3(a,b,c) scanI(a), scanI(b), scanI(c)
#define scanI4(a,b,c,d) scanI(a), scanI(b), scanI(c), scanI(d)
#define scanL(a) scanf("%lld",&a)
#define scanL2(a,b) scanL(a), scanL(b)
#define scanL3(a,b,c) scanL(a), scanL(b), scanL(c)
#define scanL4(a,b,c,d) scanL(a), scanL(b), scanL(c), scanL(d)
#define Read freopen("input.txt", "r" ,stdin)
#define Write freopen("output.txt", "w" ,stdout)
int n;
int ara[N], sum[N]={0};
int mx=0;
bool visited[N];
int main(int argc,char const *argv[]) {
scanf("%d",&n);
int tot=0;
for(int i=1;i<=n;i++) {
scanf("%d",&ara[i]);
mx=max(mx,ara[i]);
tot+=ara[i];
}
for(int i=1;i<=n;i++) {
sum[i]=ara[i];
sum[i]+=sum[i-1];
}
int k=n/2;
int j=0;
bool f=false;
vector<int> A,B;
for(int i=1;i<n;i++) {
int team1=sum[k+j]-sum[i-1];
j++;
int team2=tot-team1;
if(abs(team2-team1)<=mx) {
for(int l=i;l<k+j;l++) {
A.push_back(l);
visited[l]=true;
f=true;
}
}
if(f) break;
}
for(int i=1;i<=n;i++) {
if(!visited[i]) {
B.push_back(i);
}
}
cout<<A.size()<<endl;
for(int i=0;i<A.size();i++) {
cout<<A[i]<<" ";
}
cout<<endl;
cout<<B.size()<<endl;
for(int i=0;i<B.size();i++) {
cout<<B[i]<<" ";
}
cout<<endl;
return 0;
}
|
c85dc16a0ff2b4e6456201166217ad02649be763 | 73afb3aea37a92934318b3f7c213db9efc12ef08 | /UVA/12403/21918066_AC_0ms_0kB.cpp | 19d6b3b470b7f25c3024c37838697e406e7d0170 | [] | no_license | Philipkwandynata/COMPETITIVE-PROGRAMING | f09c98df0d17f7cfade50c5860912d0a2ca0c620 | 6b0752f4040776ea4c8a54061c32ac3cb20f9d11 | refs/heads/master | 2023-01-11T12:34:16.967651 | 2020-10-30T06:32:24 | 2020-10-30T06:32:24 | 308,540,303 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 349 | cpp | 21918066_AC_0ms_0kB.cpp | #include<stdio.h>
#include<string.h>
int main(){
int T = 0 ;
int Total = 0 ;
int K = 0 ;
scanf("%d",&T);
for(int i = 0 ; i < T ; i++ ){
char a[10] ;
getchar();scanf("%s",a);
if(strcmp(a,"donate") == 0 )
{
scanf("%d",&K);
Total = Total + K ;
}
else
{
printf("%d\n",Total);
}
}
return 0 ;
} |
a5e05b64aeb2d64b15fdb243c36947198a359aca | cd278a2cdf3fb89a26b15fa7ae8828509b584e06 | /input.h | e595fe5841deddfd0a1d6ad44cdd8c2f65a98aa7 | [] | no_license | baboulinetX0F/SDL_Pong | 6f5941156e7490e35c159a7eef294cf903d23907 | a5ecca64df75e53ee21d1abf4c1d43d12087b40b | refs/heads/master | 2021-01-10T14:04:10.837733 | 2015-12-23T00:27:45 | 2015-12-23T00:27:45 | 47,983,188 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 165 | h | input.h | #ifndef INPUT_H_INCLUDED
#define INPUT_H_INCLUDED
class InputHandler
{
public:
InputHandler(); // Default constructor
private:
};
#endif // INPUT_H_INCLUDED
|
4a936aa9a7eb38a2173e14808b41a20d6ac6f664 | c062eef20e76c756245531f8b98febf309157a4d | /Okul_Notlarım/hafta 4/degiskenArttırma_Azaltma.cpp | 6dfd35f9138bdf6791ad3b2e3e769b409d1ce840 | [] | no_license | TugayYaldiz/deu-c-notlarim | 55165fce1f55b7eadc10a32ec832117833525fb4 | 34852c786b0a447384146969e0f10f09a21585d5 | refs/heads/master | 2021-09-04T17:25:17.894879 | 2018-01-20T11:51:01 | 2018-01-20T11:51:01 | 116,670,632 | 2 | 0 | null | null | null | null | ISO-8859-9 | C++ | false | false | 380 | cpp | degiskenArttırma_Azaltma.cpp | #include <stdlib.h>
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include <locale.h>
int main() {
int a=3;
int b=3;
printf("%d\n",++a);
printf("%d\n",a);
printf("%d\n",a++);
printf("%d\n",a);
printf("a nın degeri %d",(a<b)?a++:++a);
printf("\na nın degeri %d",a+=(++a)); // ++a a nın degerını hemen degıstırır ıslem yapar oyuzden sonuc 9 degılde 10
}
|
0c6005719a431046a77aa8488ca8b399982ea0e9 | 8baa22142a09e01261c172f6dee556cc87b82935 | /slitrani/SplineFit/SplineFitDict.cpp | 9e6248a5c2feabea5ba06cb8b90e8ac4752f1072 | [] | no_license | kgregor7/ROOT5_SLitrani | 42e2be863f51f36ef30da5bc68437aaf0a6dda2e | 9bb565998496ca4a11001456d682ef28a3c118ab | refs/heads/master | 2020-03-27T01:05:32.597203 | 2018-10-17T14:53:59 | 2018-10-17T14:53:59 | 145,680,179 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 238,997 | cpp | SplineFitDict.cpp | //
// File generated by /home/gregor/root5/bin/rootcint at Sun Aug 12 09:26:27 2018
// Do NOT change. Changes will be lost next time file is generated
//
#define R__DICTIONARY_FILENAME SplineFitDict
#include "RConfig.h" //rootcint 4834
#if !defined(R__ACCESS_IN_SYMBOL)
//Break the privacy of classes -- Disabled for the moment
#define private public
#define protected public
#endif
// Since CINT ignores the std namespace, we need to do so in this file.
namespace std {} using namespace std;
#include "SplineFitDict.h"
#include "TClass.h"
#include "TBuffer.h"
#include "TMemberInspector.h"
#include "TInterpreter.h"
#include "TVirtualMutex.h"
#include "TError.h"
#ifndef G__ROOT
#define G__ROOT
#endif
#include "RtypesImp.h"
#include "TIsAProxy.h"
#include "TFileMergeInfo.h"
// Direct notice to TROOT of the dictionary's loading.
namespace {
static struct DictInit {
DictInit() {
ROOT::RegisterModule();
}
} __TheDictionaryInitializer;
}
// START OF SHADOWS
namespace ROOTShadow {
namespace Shadow {
} // of namespace Shadow
} // of namespace ROOTShadow
// END OF SHADOWS
namespace ROOTDict {
void TPoly3_ShowMembers(void *obj, TMemberInspector &R__insp);
static void *new_TPoly3(void *p = 0);
static void *newArray_TPoly3(Long_t size, void *p);
static void delete_TPoly3(void *p);
static void deleteArray_TPoly3(void *p);
static void destruct_TPoly3(void *p);
// Function generating the singleton type initializer
static ROOT::TGenericClassInfo *GenerateInitInstanceLocal(const ::TPoly3*)
{
::TPoly3 *ptr = 0;
static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy< ::TPoly3 >(0);
static ::ROOT::TGenericClassInfo
instance("TPoly3", ::TPoly3::Class_Version(), "./TPoly3.h", 16,
typeid(::TPoly3), ::ROOT::DefineBehavior(ptr, ptr),
&::TPoly3::Dictionary, isa_proxy, 4,
sizeof(::TPoly3) );
instance.SetNew(&new_TPoly3);
instance.SetNewArray(&newArray_TPoly3);
instance.SetDelete(&delete_TPoly3);
instance.SetDeleteArray(&deleteArray_TPoly3);
instance.SetDestructor(&destruct_TPoly3);
return &instance;
}
ROOT::TGenericClassInfo *GenerateInitInstance(const ::TPoly3*)
{
return GenerateInitInstanceLocal((::TPoly3*)0);
}
// Static variable to force the class initialization
static ::ROOT::TGenericClassInfo *_R__UNIQUE_(Init) = GenerateInitInstanceLocal((const ::TPoly3*)0x0); R__UseDummy(_R__UNIQUE_(Init));
} // end of namespace ROOTDict
namespace ROOTDict {
void TBandedLE_ShowMembers(void *obj, TMemberInspector &R__insp);
static void *new_TBandedLE(void *p = 0);
static void *newArray_TBandedLE(Long_t size, void *p);
static void delete_TBandedLE(void *p);
static void deleteArray_TBandedLE(void *p);
static void destruct_TBandedLE(void *p);
// Function generating the singleton type initializer
static ROOT::TGenericClassInfo *GenerateInitInstanceLocal(const ::TBandedLE*)
{
::TBandedLE *ptr = 0;
static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy< ::TBandedLE >(0);
static ::ROOT::TGenericClassInfo
instance("TBandedLE", ::TBandedLE::Class_Version(), "./TBandedLE.h", 12,
typeid(::TBandedLE), ::ROOT::DefineBehavior(ptr, ptr),
&::TBandedLE::Dictionary, isa_proxy, 4,
sizeof(::TBandedLE) );
instance.SetNew(&new_TBandedLE);
instance.SetNewArray(&newArray_TBandedLE);
instance.SetDelete(&delete_TBandedLE);
instance.SetDeleteArray(&deleteArray_TBandedLE);
instance.SetDestructor(&destruct_TBandedLE);
return &instance;
}
ROOT::TGenericClassInfo *GenerateInitInstance(const ::TBandedLE*)
{
return GenerateInitInstanceLocal((::TBandedLE*)0);
}
// Static variable to force the class initialization
static ::ROOT::TGenericClassInfo *_R__UNIQUE_(Init) = GenerateInitInstanceLocal((const ::TBandedLE*)0x0); R__UseDummy(_R__UNIQUE_(Init));
} // end of namespace ROOTDict
namespace ROOTDict {
void TZigZag_ShowMembers(void *obj, TMemberInspector &R__insp);
static void *new_TZigZag(void *p = 0);
static void *newArray_TZigZag(Long_t size, void *p);
static void delete_TZigZag(void *p);
static void deleteArray_TZigZag(void *p);
static void destruct_TZigZag(void *p);
// Function generating the singleton type initializer
static ROOT::TGenericClassInfo *GenerateInitInstanceLocal(const ::TZigZag*)
{
::TZigZag *ptr = 0;
static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy< ::TZigZag >(0);
static ::ROOT::TGenericClassInfo
instance("TZigZag", ::TZigZag::Class_Version(), "./TZigZag.h", 13,
typeid(::TZigZag), ::ROOT::DefineBehavior(ptr, ptr),
&::TZigZag::Dictionary, isa_proxy, 4,
sizeof(::TZigZag) );
instance.SetNew(&new_TZigZag);
instance.SetNewArray(&newArray_TZigZag);
instance.SetDelete(&delete_TZigZag);
instance.SetDeleteArray(&deleteArray_TZigZag);
instance.SetDestructor(&destruct_TZigZag);
return &instance;
}
ROOT::TGenericClassInfo *GenerateInitInstance(const ::TZigZag*)
{
return GenerateInitInstanceLocal((::TZigZag*)0);
}
// Static variable to force the class initialization
static ::ROOT::TGenericClassInfo *_R__UNIQUE_(Init) = GenerateInitInstanceLocal((const ::TZigZag*)0x0); R__UseDummy(_R__UNIQUE_(Init));
} // end of namespace ROOTDict
namespace ROOTDict {
void TSplineFit_ShowMembers(void *obj, TMemberInspector &R__insp);
static void *new_TSplineFit(void *p = 0);
static void *newArray_TSplineFit(Long_t size, void *p);
static void delete_TSplineFit(void *p);
static void deleteArray_TSplineFit(void *p);
static void destruct_TSplineFit(void *p);
// Function generating the singleton type initializer
static ROOT::TGenericClassInfo *GenerateInitInstanceLocal(const ::TSplineFit*)
{
::TSplineFit *ptr = 0;
static ::TVirtualIsAProxy* isa_proxy = new ::TInstrumentedIsAProxy< ::TSplineFit >(0);
static ::ROOT::TGenericClassInfo
instance("TSplineFit", ::TSplineFit::Class_Version(), "./TSplineFit.h", 30,
typeid(::TSplineFit), ::ROOT::DefineBehavior(ptr, ptr),
&::TSplineFit::Dictionary, isa_proxy, 4,
sizeof(::TSplineFit) );
instance.SetNew(&new_TSplineFit);
instance.SetNewArray(&newArray_TSplineFit);
instance.SetDelete(&delete_TSplineFit);
instance.SetDeleteArray(&deleteArray_TSplineFit);
instance.SetDestructor(&destruct_TSplineFit);
return &instance;
}
ROOT::TGenericClassInfo *GenerateInitInstance(const ::TSplineFit*)
{
return GenerateInitInstanceLocal((::TSplineFit*)0);
}
// Static variable to force the class initialization
static ::ROOT::TGenericClassInfo *_R__UNIQUE_(Init) = GenerateInitInstanceLocal((const ::TSplineFit*)0x0); R__UseDummy(_R__UNIQUE_(Init));
} // end of namespace ROOTDict
//______________________________________________________________________________
atomic_TClass_ptr TPoly3::fgIsA(0); // static to hold class pointer
//______________________________________________________________________________
const char *TPoly3::Class_Name()
{
return "TPoly3";
}
//______________________________________________________________________________
const char *TPoly3::ImplFileName()
{
return ::ROOTDict::GenerateInitInstanceLocal((const ::TPoly3*)0x0)->GetImplFileName();
}
//______________________________________________________________________________
int TPoly3::ImplFileLine()
{
return ::ROOTDict::GenerateInitInstanceLocal((const ::TPoly3*)0x0)->GetImplFileLine();
}
//______________________________________________________________________________
void TPoly3::Dictionary()
{
fgIsA = ::ROOTDict::GenerateInitInstanceLocal((const ::TPoly3*)0x0)->GetClass();
}
//______________________________________________________________________________
TClass *TPoly3::Class()
{
if (!fgIsA) { R__LOCKGUARD2(gCINTMutex); if(!fgIsA) {fgIsA = ::ROOTDict::GenerateInitInstanceLocal((const ::TPoly3*)0x0)->GetClass();} }
return fgIsA;
}
//______________________________________________________________________________
atomic_TClass_ptr TBandedLE::fgIsA(0); // static to hold class pointer
//______________________________________________________________________________
const char *TBandedLE::Class_Name()
{
return "TBandedLE";
}
//______________________________________________________________________________
const char *TBandedLE::ImplFileName()
{
return ::ROOTDict::GenerateInitInstanceLocal((const ::TBandedLE*)0x0)->GetImplFileName();
}
//______________________________________________________________________________
int TBandedLE::ImplFileLine()
{
return ::ROOTDict::GenerateInitInstanceLocal((const ::TBandedLE*)0x0)->GetImplFileLine();
}
//______________________________________________________________________________
void TBandedLE::Dictionary()
{
fgIsA = ::ROOTDict::GenerateInitInstanceLocal((const ::TBandedLE*)0x0)->GetClass();
}
//______________________________________________________________________________
TClass *TBandedLE::Class()
{
if (!fgIsA) { R__LOCKGUARD2(gCINTMutex); if(!fgIsA) {fgIsA = ::ROOTDict::GenerateInitInstanceLocal((const ::TBandedLE*)0x0)->GetClass();} }
return fgIsA;
}
//______________________________________________________________________________
atomic_TClass_ptr TZigZag::fgIsA(0); // static to hold class pointer
//______________________________________________________________________________
const char *TZigZag::Class_Name()
{
return "TZigZag";
}
//______________________________________________________________________________
const char *TZigZag::ImplFileName()
{
return ::ROOTDict::GenerateInitInstanceLocal((const ::TZigZag*)0x0)->GetImplFileName();
}
//______________________________________________________________________________
int TZigZag::ImplFileLine()
{
return ::ROOTDict::GenerateInitInstanceLocal((const ::TZigZag*)0x0)->GetImplFileLine();
}
//______________________________________________________________________________
void TZigZag::Dictionary()
{
fgIsA = ::ROOTDict::GenerateInitInstanceLocal((const ::TZigZag*)0x0)->GetClass();
}
//______________________________________________________________________________
TClass *TZigZag::Class()
{
if (!fgIsA) { R__LOCKGUARD2(gCINTMutex); if(!fgIsA) {fgIsA = ::ROOTDict::GenerateInitInstanceLocal((const ::TZigZag*)0x0)->GetClass();} }
return fgIsA;
}
//______________________________________________________________________________
atomic_TClass_ptr TSplineFit::fgIsA(0); // static to hold class pointer
//______________________________________________________________________________
const char *TSplineFit::Class_Name()
{
return "TSplineFit";
}
//______________________________________________________________________________
const char *TSplineFit::ImplFileName()
{
return ::ROOTDict::GenerateInitInstanceLocal((const ::TSplineFit*)0x0)->GetImplFileName();
}
//______________________________________________________________________________
int TSplineFit::ImplFileLine()
{
return ::ROOTDict::GenerateInitInstanceLocal((const ::TSplineFit*)0x0)->GetImplFileLine();
}
//______________________________________________________________________________
void TSplineFit::Dictionary()
{
fgIsA = ::ROOTDict::GenerateInitInstanceLocal((const ::TSplineFit*)0x0)->GetClass();
}
//______________________________________________________________________________
TClass *TSplineFit::Class()
{
if (!fgIsA) { R__LOCKGUARD2(gCINTMutex); if(!fgIsA) {fgIsA = ::ROOTDict::GenerateInitInstanceLocal((const ::TSplineFit*)0x0)->GetClass();} }
return fgIsA;
}
//______________________________________________________________________________
void TPoly3::Streamer(TBuffer &R__b)
{
// Stream an object of class TPoly3.
if (R__b.IsReading()) {
R__b.ReadClassBuffer(TPoly3::Class(),this);
} else {
R__b.WriteClassBuffer(TPoly3::Class(),this);
}
}
//______________________________________________________________________________
void TPoly3::ShowMembers(TMemberInspector &R__insp)
{
// Inspect the data members of an object of class TPoly3.
TClass *R__cl = ::TPoly3::IsA();
if (R__cl || R__insp.IsA()) { }
R__insp.Inspect(R__cl, R__insp.GetParent(), "fA[4]", fA);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fN", &fN);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fComp", &fComp);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fY0", &fY0);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fX1", &fX1);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fX2", &fX2);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fX3", &fX3);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fMin", &fMin);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fXMin", &fXMin);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fYMin", &fYMin);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fMax", &fMax);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fXMax", &fXMax);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fYMax", &fYMax);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fInfl", &fInfl);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fXInfl", &fXInfl);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fYInfl", &fYInfl);
TObject::ShowMembers(R__insp);
}
namespace ROOTDict {
// Wrappers around operator new
static void *new_TPoly3(void *p) {
return p ? new(p) ::TPoly3 : new ::TPoly3;
}
static void *newArray_TPoly3(Long_t nElements, void *p) {
return p ? new(p) ::TPoly3[nElements] : new ::TPoly3[nElements];
}
// Wrapper around operator delete
static void delete_TPoly3(void *p) {
delete ((::TPoly3*)p);
}
static void deleteArray_TPoly3(void *p) {
delete [] ((::TPoly3*)p);
}
static void destruct_TPoly3(void *p) {
typedef ::TPoly3 current_t;
((current_t*)p)->~current_t();
}
} // end of namespace ROOTDict for class ::TPoly3
//______________________________________________________________________________
void TZigZag::Streamer(TBuffer &R__b)
{
// Stream an object of class TZigZag.
if (R__b.IsReading()) {
R__b.ReadClassBuffer(TZigZag::Class(),this);
} else {
R__b.WriteClassBuffer(TZigZag::Class(),this);
}
}
//______________________________________________________________________________
void TZigZag::ShowMembers(TMemberInspector &R__insp)
{
// Inspect the data members of an object of class TZigZag.
TClass *R__cl = ::TZigZag::IsA();
if (R__cl || R__insp.IsA()) { }
R__insp.Inspect(R__cl, R__insp.GetParent(), "fDim", &fDim);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fNx", &fNx);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fNy", &fNy);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fNz", &fNz);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fXmin", &fXmin);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fYmin", &fYmin);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fZmin", &fZmin);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fXmax", &fXmax);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fYmax", &fYmax);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fZmax", &fZmax);
TObject::ShowMembers(R__insp);
}
namespace ROOTDict {
// Wrappers around operator new
static void *new_TZigZag(void *p) {
return p ? new(p) ::TZigZag : new ::TZigZag;
}
static void *newArray_TZigZag(Long_t nElements, void *p) {
return p ? new(p) ::TZigZag[nElements] : new ::TZigZag[nElements];
}
// Wrapper around operator delete
static void delete_TZigZag(void *p) {
delete ((::TZigZag*)p);
}
static void deleteArray_TZigZag(void *p) {
delete [] ((::TZigZag*)p);
}
static void destruct_TZigZag(void *p) {
typedef ::TZigZag current_t;
((current_t*)p)->~current_t();
}
} // end of namespace ROOTDict for class ::TZigZag
//______________________________________________________________________________
void TBandedLE::Streamer(TBuffer &R__b)
{
// Stream an object of class TBandedLE.
if (R__b.IsReading()) {
R__b.ReadClassBuffer(TBandedLE::Class(),this);
} else {
R__b.WriteClassBuffer(TBandedLE::Class(),this);
}
}
//______________________________________________________________________________
void TBandedLE::ShowMembers(TMemberInspector &R__insp)
{
// Inspect the data members of an object of class TBandedLE.
TClass *R__cl = ::TBandedLE::IsA();
if (R__cl || R__insp.IsA()) { }
R__insp.Inspect(R__cl, R__insp.GetParent(), "fF", &fF);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fN", &fN);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fM", &fM);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fK", &fK);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fOwnA", &fOwnA);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fOwnB", &fOwnB);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fA", &fA);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fB", &fB);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fX", &fX);
R__insp.InspectMember(fX, "fX.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fV", &fV);
R__insp.InspectMember(fV, "fV.");
TObject::ShowMembers(R__insp);
}
namespace ROOTDict {
// Wrappers around operator new
static void *new_TBandedLE(void *p) {
return p ? new(p) ::TBandedLE : new ::TBandedLE;
}
static void *newArray_TBandedLE(Long_t nElements, void *p) {
return p ? new(p) ::TBandedLE[nElements] : new ::TBandedLE[nElements];
}
// Wrapper around operator delete
static void delete_TBandedLE(void *p) {
delete ((::TBandedLE*)p);
}
static void deleteArray_TBandedLE(void *p) {
delete [] ((::TBandedLE*)p);
}
static void destruct_TBandedLE(void *p) {
typedef ::TBandedLE current_t;
((current_t*)p)->~current_t();
}
} // end of namespace ROOTDict for class ::TBandedLE
//______________________________________________________________________________
void TSplineFit::Streamer(TBuffer &R__b)
{
// Stream an object of class TSplineFit.
if (R__b.IsReading()) {
R__b.ReadClassBuffer(TSplineFit::Class(),this);
} else {
R__b.WriteClassBuffer(TSplineFit::Class(),this);
}
}
//______________________________________________________________________________
void TSplineFit::ShowMembers(TMemberInspector &R__insp)
{
// Inspect the data members of an object of class TSplineFit.
TClass *R__cl = ::TSplineFit::IsA();
if (R__cl || R__insp.IsA()) { }
R__insp.Inspect(R__cl, R__insp.GetParent(), "fType", &fType);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fCat", &fCat);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fNbInFamily", &fNbInFamily);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fM", &fM);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fMi", &fMi);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fMl", &fMl);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fN", &fN);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fNs2", &fNs2);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fSlope", &fSlope);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fCst", &fCst);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fBoundedLow", &fBoundedLow);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fLowBound", &fLowBound);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fBoundedUp", &fBoundedUp);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fUpBound", &fUpBound);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fA", &fA);
R__insp.InspectMember(fA, "fA.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fB", &fB);
R__insp.InspectMember(fB, "fB.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fX", &fX);
R__insp.InspectMember(fX, "fX.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fKhi", &fKhi);
R__insp.InspectMember(fKhi, "fKhi.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fMt", &fMt);
R__insp.InspectMember(fMt, "fMt.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fMv", &fMv);
R__insp.InspectMember(fMv, "fMv.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fMs", &fMs);
R__insp.InspectMember(fMs, "fMs.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fUseForRandom", &fUseForRandom);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fParameter", &fParameter);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fParameterDef", &fParameterDef);
R__insp.InspectMember(fParameterDef, "fParameterDef.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fZigZag", &fZigZag);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fDate", &fDate);
R__insp.InspectMember(fDate, "fDate.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fSource", &fSource);
R__insp.InspectMember(fSource, "fSource.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fMacro", &fMacro);
R__insp.InspectMember(fMacro, "fMacro.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fXLabel", &fXLabel);
R__insp.InspectMember(fXLabel, "fXLabel.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fYLabel", &fYLabel);
R__insp.InspectMember(fYLabel, "fYLabel.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fZLabel", &fZLabel);
R__insp.InspectMember(fZLabel, "fZLabel.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fVLabel", &fVLabel);
R__insp.InspectMember(fVLabel, "fVLabel.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "fMemoryReduced", &fMemoryReduced);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fInterpolation", &fInterpolation);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fHGenRandom", &fHGenRandom);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fHShowRandom", &fHShowRandom);
R__insp.Inspect(R__cl, R__insp.GetParent(), "fProvidedName", &fProvidedName);
R__insp.InspectMember(fProvidedName, "fProvidedName.");
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fSplineFitFunc", &fSplineFitFunc);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fPointsGraph", &fPointsGraph);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fSplineGraph", &fSplineGraph);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fPS", &fPS);
R__insp.Inspect(R__cl, R__insp.GetParent(), "f2Drestored", &f2Drestored);
R__insp.Inspect(R__cl, R__insp.GetParent(), "f3Drestored", &f3Drestored);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fProvidedH1D", &fProvidedH1D);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fProvidedH2D", &fProvidedH2D);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fH2Dfit", &fH2Dfit);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fProvidedH3D", &fProvidedH3D);
R__insp.Inspect(R__cl, R__insp.GetParent(), "*fH3Dfit", &fH3Dfit);
TNamed::ShowMembers(R__insp);
}
namespace ROOTDict {
// Wrappers around operator new
static void *new_TSplineFit(void *p) {
return p ? new(p) ::TSplineFit : new ::TSplineFit;
}
static void *newArray_TSplineFit(Long_t nElements, void *p) {
return p ? new(p) ::TSplineFit[nElements] : new ::TSplineFit[nElements];
}
// Wrapper around operator delete
static void delete_TSplineFit(void *p) {
delete ((::TSplineFit*)p);
}
static void deleteArray_TSplineFit(void *p) {
delete [] ((::TSplineFit*)p);
}
static void destruct_TSplineFit(void *p) {
typedef ::TSplineFit current_t;
((current_t*)p)->~current_t();
}
} // end of namespace ROOTDict for class ::TSplineFit
/********************************************************
* SplineFitDict.cpp
* CAUTION: DON'T CHANGE THIS FILE. THIS FILE IS AUTOMATICALLY GENERATED
* FROM HEADER FILES LISTED IN G__setup_cpp_environmentXXX().
* CHANGE THOSE HEADER FILES AND REGENERATE THIS FILE.
********************************************************/
#ifdef G__MEMTEST
#undef malloc
#undef free
#endif
#if defined(__GNUC__) && __GNUC__ >= 4 && ((__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >= 1) || (__GNUC_MINOR__ >= 3))
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif
extern "C" void G__cpp_reset_tagtableSplineFitDict();
extern "C" void G__set_cpp_environmentSplineFitDict() {
G__add_compiledheader("TObject.h");
G__add_compiledheader("TMemberInspector.h");
G__add_compiledheader("TPoly3.h");
G__add_compiledheader("TBandedLE.h");
G__add_compiledheader("TZigZag.h");
G__add_compiledheader("TSplineFit.h");
G__cpp_reset_tagtableSplineFitDict();
}
#include <new>
extern "C" int G__cpp_dllrevSplineFitDict() { return(30051515); }
/*********************************************************
* Member function Interface Method
*********************************************************/
/* TPoly3 */
static int G__SplineFitDict_107_0_4(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TPoly3* p = NULL;
char* gvp = (char*) G__getgvp();
int n = G__getaryconstruct();
if (n) {
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TPoly3[n];
} else {
p = new((void*) gvp) TPoly3[n];
}
} else {
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TPoly3;
} else {
p = new((void*) gvp) TPoly3;
}
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_5(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TPoly3* p = NULL;
char* gvp = (char*) G__getgvp();
//m: 4
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TPoly3(
(Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]), (Double_t) G__double(libp->para[3]));
} else {
p = new((void*) gvp) TPoly3(
(Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]), (Double_t) G__double(libp->para[3]));
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_6(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TPoly3* p = NULL;
char* gvp = (char*) G__getgvp();
//m: 1
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TPoly3((Double_t*) G__int(libp->para[0]));
} else {
p = new((void*) gvp) TPoly3((Double_t*) G__int(libp->para[0]));
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_7(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 115, (long) ((TPoly3*) G__getstructoffset())->Degree());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_8(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TPoly3*) G__getstructoffset())->Extrema();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_9(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((TPoly3*) G__getstructoffset())->Integral((Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_10(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TPoly3*) G__getstructoffset())->Set((Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]), (Double_t) G__double(libp->para[3]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_11(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TPoly3*) G__getstructoffset())->Set((Double_t*) G__int(libp->para[0]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_12(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 115, (long) ((TPoly3*) G__getstructoffset())->Solution(*(Double_t*) G__Doubleref(&libp->para[0]), *(Double_t*) G__Doubleref(&libp->para[1])
, *(Double_t*) G__Doubleref(&libp->para[2]), *(Double_t*) G__Doubleref(&libp->para[3])
, *(Bool_t*) G__Boolref(&libp->para[4])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_13(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 1:
((TPoly3*) G__getstructoffset())->Solve((Double_t) G__double(libp->para[0]));
G__setnull(result7);
break;
case 0:
((TPoly3*) G__getstructoffset())->Solve();
G__setnull(result7);
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_14(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 5:
G__letint(result7, 115, (long) ((TPoly3*) G__getstructoffset())->Solve(*(Double_t*) G__Doubleref(&libp->para[0]), *(Double_t*) G__Doubleref(&libp->para[1])
, *(Double_t*) G__Doubleref(&libp->para[2]), *(Bool_t*) G__Boolref(&libp->para[3])
, (Double_t) G__double(libp->para[4])));
break;
case 4:
G__letint(result7, 115, (long) ((TPoly3*) G__getstructoffset())->Solve(*(Double_t*) G__Doubleref(&libp->para[0]), *(Double_t*) G__Doubleref(&libp->para[1])
, *(Double_t*) G__Doubleref(&libp->para[2]), *(Bool_t*) G__Boolref(&libp->para[3])));
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_15(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 5:
G__letint(result7, 103, (long) ((TPoly3*) G__getstructoffset())->SolveLeft(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])
, (Bool_t) G__int(libp->para[2]), (Double_t) G__double(libp->para[3])
, (Double_t) G__double(libp->para[4])));
break;
case 4:
G__letint(result7, 103, (long) ((TPoly3*) G__getstructoffset())->SolveLeft(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])
, (Bool_t) G__int(libp->para[2]), (Double_t) G__double(libp->para[3])));
break;
case 3:
G__letint(result7, 103, (long) ((TPoly3*) G__getstructoffset())->SolveLeft(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])
, (Bool_t) G__int(libp->para[2])));
break;
case 2:
G__letint(result7, 103, (long) ((TPoly3*) G__getstructoffset())->SolveLeft(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])));
break;
case 1:
G__letint(result7, 103, (long) ((TPoly3*) G__getstructoffset())->SolveLeft(*(Double_t*) G__Doubleref(&libp->para[0])));
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_16(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 5:
G__letint(result7, 103, (long) ((TPoly3*) G__getstructoffset())->SolveRight(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])
, (Bool_t) G__int(libp->para[2]), (Double_t) G__double(libp->para[3])
, (Double_t) G__double(libp->para[4])));
break;
case 4:
G__letint(result7, 103, (long) ((TPoly3*) G__getstructoffset())->SolveRight(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])
, (Bool_t) G__int(libp->para[2]), (Double_t) G__double(libp->para[3])));
break;
case 3:
G__letint(result7, 103, (long) ((TPoly3*) G__getstructoffset())->SolveRight(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])
, (Bool_t) G__int(libp->para[2])));
break;
case 2:
G__letint(result7, 103, (long) ((TPoly3*) G__getstructoffset())->SolveRight(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])));
break;
case 1:
G__letint(result7, 103, (long) ((TPoly3*) G__getstructoffset())->SolveRight(*(Double_t*) G__Doubleref(&libp->para[0])));
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_17(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((TPoly3*) G__getstructoffset())->Y((Double_t) G__double(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_18(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) TPoly3::Class());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_19(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TPoly3::Class_Name());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_20(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 115, (long) TPoly3::Class_Version());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_21(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TPoly3::Dictionary();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_25(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TPoly3*) G__getstructoffset())->StreamerNVirtual(*(TBuffer*) libp->para[0].ref);
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_26(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TPoly3::DeclFileName());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_27(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) TPoly3::ImplFileLine());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_28(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TPoly3::ImplFileName());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_107_0_29(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) TPoly3::DeclFileLine());
return(1 || funcname || hash || result7 || libp) ;
}
// automatic copy constructor
static int G__SplineFitDict_107_0_30(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TPoly3* p;
void* tmp = (void*) G__int(libp->para[0]);
p = new TPoly3(*(TPoly3*) tmp);
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3));
return(1 || funcname || hash || result7 || libp) ;
}
// automatic destructor
typedef TPoly3 G__TTPoly3;
static int G__SplineFitDict_107_0_31(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
char* gvp = (char*) G__getgvp();
long soff = G__getstructoffset();
int n = G__getaryconstruct();
//
//has_a_delete: 1
//has_own_delete1arg: 0
//has_own_delete2arg: 0
//
if (!soff) {
return(1);
}
if (n) {
if (gvp == (char*)G__PVOID) {
delete[] (TPoly3*) soff;
} else {
G__setgvp((long) G__PVOID);
for (int i = n - 1; i >= 0; --i) {
((TPoly3*) (soff+(sizeof(TPoly3)*i)))->~G__TTPoly3();
}
G__setgvp((long)gvp);
}
} else {
if (gvp == (char*)G__PVOID) {
delete (TPoly3*) soff;
} else {
G__setgvp((long) G__PVOID);
((TPoly3*) (soff))->~G__TTPoly3();
G__setgvp((long)gvp);
}
}
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
// automatic assignment operator
static int G__SplineFitDict_107_0_32(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TPoly3* dest = (TPoly3*) G__getstructoffset();
*dest = *(TPoly3*) libp->para[0].ref;
const TPoly3& obj = *dest;
result7->ref = (long) (&obj);
result7->obj.i = (long) (&obj);
return(1 || funcname || hash || result7 || libp) ;
}
/* TBandedLE */
static int G__SplineFitDict_192_0_3(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TBandedLE* p = NULL;
char* gvp = (char*) G__getgvp();
int n = G__getaryconstruct();
if (n) {
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TBandedLE[n];
} else {
p = new((void*) gvp) TBandedLE[n];
}
} else {
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TBandedLE;
} else {
p = new((void*) gvp) TBandedLE;
}
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_4(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TBandedLE* p = NULL;
char* gvp = (char*) G__getgvp();
switch (libp->paran) {
case 6:
//m: 6
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TBandedLE(
(Int_t) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), *(TMatrixD*) libp->para[3].ref
, *(TMatrixD*) libp->para[4].ref, (Bool_t) G__int(libp->para[5]));
} else {
p = new((void*) gvp) TBandedLE(
(Int_t) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), *(TMatrixD*) libp->para[3].ref
, *(TMatrixD*) libp->para[4].ref, (Bool_t) G__int(libp->para[5]));
}
break;
case 5:
//m: 5
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TBandedLE(
(Int_t) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), *(TMatrixD*) libp->para[3].ref
, *(TMatrixD*) libp->para[4].ref);
} else {
p = new((void*) gvp) TBandedLE(
(Int_t) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), *(TMatrixD*) libp->para[3].ref
, *(TMatrixD*) libp->para[4].ref);
}
break;
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_5(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TBandedLE* p = NULL;
char* gvp = (char*) G__getgvp();
switch (libp->paran) {
case 4:
//m: 4
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TBandedLE(
*(TMatrixD*) libp->para[0].ref, *(TMatrixD*) libp->para[1].ref
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3]));
} else {
p = new((void*) gvp) TBandedLE(
*(TMatrixD*) libp->para[0].ref, *(TMatrixD*) libp->para[1].ref
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3]));
}
break;
case 3:
//m: 3
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TBandedLE(
*(TMatrixD*) libp->para[0].ref, *(TMatrixD*) libp->para[1].ref
, (Int_t) G__int(libp->para[2]));
} else {
p = new((void*) gvp) TBandedLE(
*(TMatrixD*) libp->para[0].ref, *(TMatrixD*) libp->para[1].ref
, (Int_t) G__int(libp->para[2]));
}
break;
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_6(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TBandedLE* p = NULL;
char* gvp = (char*) G__getgvp();
switch (libp->paran) {
case 3:
//m: 3
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TBandedLE(
*(TMatrixD*) libp->para[0].ref, (Int_t) G__int(libp->para[1])
, (Bool_t) G__int(libp->para[2]));
} else {
p = new((void*) gvp) TBandedLE(
*(TMatrixD*) libp->para[0].ref, (Int_t) G__int(libp->para[1])
, (Bool_t) G__int(libp->para[2]));
}
break;
case 2:
//m: 2
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TBandedLE(*(TMatrixD*) libp->para[0].ref, (Int_t) G__int(libp->para[1]));
} else {
p = new((void*) gvp) TBandedLE(*(TMatrixD*) libp->para[0].ref, (Int_t) G__int(libp->para[1]));
}
break;
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_7(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) ((TBandedLE*) G__getstructoffset())->GetfA());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_8(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) ((TBandedLE*) G__getstructoffset())->GetfB());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_9(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((TBandedLE*) G__getstructoffset())->GetfF());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_10(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((TBandedLE*) G__getstructoffset())->GetfK());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_11(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((TBandedLE*) G__getstructoffset())->GetfM());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_12(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((TBandedLE*) G__getstructoffset())->GetfN());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_13(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((TBandedLE*) G__getstructoffset())->Solve());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_14(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TBandedLE*) G__getstructoffset())->Verify());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_15(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) TBandedLE::Class());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_16(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TBandedLE::Class_Name());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_17(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 115, (long) TBandedLE::Class_Version());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_18(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TBandedLE::Dictionary();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_22(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TBandedLE*) G__getstructoffset())->StreamerNVirtual(*(TBuffer*) libp->para[0].ref);
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_23(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TBandedLE::DeclFileName());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_24(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) TBandedLE::ImplFileLine());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_25(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TBandedLE::ImplFileName());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_192_0_26(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) TBandedLE::DeclFileLine());
return(1 || funcname || hash || result7 || libp) ;
}
// automatic copy constructor
static int G__SplineFitDict_192_0_27(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TBandedLE* p;
void* tmp = (void*) G__int(libp->para[0]);
p = new TBandedLE(*(TBandedLE*) tmp);
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE));
return(1 || funcname || hash || result7 || libp) ;
}
// automatic destructor
typedef TBandedLE G__TTBandedLE;
static int G__SplineFitDict_192_0_28(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
char* gvp = (char*) G__getgvp();
long soff = G__getstructoffset();
int n = G__getaryconstruct();
//
//has_a_delete: 1
//has_own_delete1arg: 0
//has_own_delete2arg: 0
//
if (!soff) {
return(1);
}
if (n) {
if (gvp == (char*)G__PVOID) {
delete[] (TBandedLE*) soff;
} else {
G__setgvp((long) G__PVOID);
for (int i = n - 1; i >= 0; --i) {
((TBandedLE*) (soff+(sizeof(TBandedLE)*i)))->~G__TTBandedLE();
}
G__setgvp((long)gvp);
}
} else {
if (gvp == (char*)G__PVOID) {
delete (TBandedLE*) soff;
} else {
G__setgvp((long) G__PVOID);
((TBandedLE*) (soff))->~G__TTBandedLE();
G__setgvp((long)gvp);
}
}
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
// automatic assignment operator
static int G__SplineFitDict_192_0_29(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TBandedLE* dest = (TBandedLE*) G__getstructoffset();
*dest = *(TBandedLE*) libp->para[0].ref;
const TBandedLE& obj = *dest;
result7->ref = (long) (&obj);
result7->obj.i = (long) (&obj);
return(1 || funcname || hash || result7 || libp) ;
}
/* TZigZag */
static int G__SplineFitDict_196_0_2(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TZigZag* p = NULL;
char* gvp = (char*) G__getgvp();
int n = G__getaryconstruct();
if (n) {
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TZigZag[n];
} else {
p = new((void*) gvp) TZigZag[n];
}
} else {
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TZigZag;
} else {
p = new((void*) gvp) TZigZag;
}
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_3(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TZigZag* p = NULL;
char* gvp = (char*) G__getgvp();
//m: 3
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TZigZag(
(Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]));
} else {
p = new((void*) gvp) TZigZag(
(Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]));
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_4(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TZigZag* p = NULL;
char* gvp = (char*) G__getgvp();
//m: 6
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TZigZag(
(Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Double_t) G__double(libp->para[5]));
} else {
p = new((void*) gvp) TZigZag(
(Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Double_t) G__double(libp->para[5]));
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_5(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TZigZag* p = NULL;
char* gvp = (char*) G__getgvp();
//m: 9
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TZigZag(
(Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Double_t) G__double(libp->para[5])
, (Int_t) G__int(libp->para[6]), (Double_t) G__double(libp->para[7])
, (Double_t) G__double(libp->para[8]));
} else {
p = new((void*) gvp) TZigZag(
(Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Double_t) G__double(libp->para[5])
, (Int_t) G__int(libp->para[6]), (Double_t) G__double(libp->para[7])
, (Double_t) G__double(libp->para[8]));
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_6(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TZigZag* p = NULL;
char* gvp = (char*) G__getgvp();
//m: 1
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TZigZag(*(TZigZag*) libp->para[0].ref);
} else {
p = new((void*) gvp) TZigZag(*(TZigZag*) libp->para[0].ref);
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_7(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TZigZag*) G__getstructoffset())->GetNx());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_8(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TZigZag*) G__getstructoffset())->GetNy());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_9(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TZigZag*) G__getstructoffset())->GetNz());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_10(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TZigZag*) G__getstructoffset())->GetXmin());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_11(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TZigZag*) G__getstructoffset())->GetXmax());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_12(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TZigZag*) G__getstructoffset())->GetYmin());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_13(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TZigZag*) G__getstructoffset())->GetYmax());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_14(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TZigZag*) G__getstructoffset())->GetZmin());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_15(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TZigZag*) G__getstructoffset())->GetZmax());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_16(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TZigZag*) G__getstructoffset())->IsInside(
(Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]), (Double_t) G__double(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Double_t) G__double(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Double_t) G__double(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Double_t) G__double(libp->para[9])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_17(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TZigZag*) G__getstructoffset())->IsInside(
(Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]), (Double_t) G__double(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Double_t) G__double(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Double_t) G__double(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Double_t) G__double(libp->para[10]), (Double_t) G__double(libp->para[11])
, (Double_t) G__double(libp->para[12]), (Double_t) G__double(libp->para[13])
, (Double_t) G__double(libp->para[14])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_18(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TZigZag*) G__getstructoffset())->NearestPoints((Double_t) G__double(libp->para[0]), *(TArrayI*) libp->para[1].ref
, *(TArrayD*) libp->para[2].ref));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_19(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TZigZag*) G__getstructoffset())->NearestPoints((Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2]), *(TArrayI*) libp->para[3].ref
, *(TArrayD*) libp->para[4].ref));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_20(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TZigZag*) G__getstructoffset())->NToZZ((Int_t) G__int(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_21(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TZigZag*) G__getstructoffset())->NToZZ((Int_t) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_22(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TZigZag*) G__getstructoffset())->NToZZ((Int_t) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_23(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((const TZigZag*) G__getstructoffset())->Order((Int_t) G__int(libp->para[0]), *(TArrayI*) libp->para[1].ref
, *(TArrayD*) libp->para[2].ref, *(TArrayD*) libp->para[3].ref
, *(TArrayD*) libp->para[4].ref);
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_24(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TZigZag*) G__getstructoffset())->PointsNear((Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])
, *(Double_t*) G__Doubleref(&libp->para[2]), *(TArrayD*) libp->para[3].ref
, *(TArrayD*) libp->para[4].ref));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_25(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TZigZag*) G__getstructoffset())->T((Int_t) G__int(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_26(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TZigZag*) G__getstructoffset())->TMax());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_27(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) TZigZag::Class());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_28(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TZigZag::Class_Name());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_29(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 115, (long) TZigZag::Class_Version());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_30(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TZigZag::Dictionary();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_34(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TZigZag*) G__getstructoffset())->StreamerNVirtual(*(TBuffer*) libp->para[0].ref);
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_35(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TZigZag::DeclFileName());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_36(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) TZigZag::ImplFileLine());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_37(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TZigZag::ImplFileName());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_196_0_38(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) TZigZag::DeclFileLine());
return(1 || funcname || hash || result7 || libp) ;
}
// automatic destructor
typedef TZigZag G__TTZigZag;
static int G__SplineFitDict_196_0_39(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
char* gvp = (char*) G__getgvp();
long soff = G__getstructoffset();
int n = G__getaryconstruct();
//
//has_a_delete: 1
//has_own_delete1arg: 0
//has_own_delete2arg: 0
//
if (!soff) {
return(1);
}
if (n) {
if (gvp == (char*)G__PVOID) {
delete[] (TZigZag*) soff;
} else {
G__setgvp((long) G__PVOID);
for (int i = n - 1; i >= 0; --i) {
((TZigZag*) (soff+(sizeof(TZigZag)*i)))->~G__TTZigZag();
}
G__setgvp((long)gvp);
}
} else {
if (gvp == (char*)G__PVOID) {
delete (TZigZag*) soff;
} else {
G__setgvp((long) G__PVOID);
((TZigZag*) (soff))->~G__TTZigZag();
G__setgvp((long)gvp);
}
}
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
// automatic assignment operator
static int G__SplineFitDict_196_0_40(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TZigZag* dest = (TZigZag*) G__getstructoffset();
*dest = *(TZigZag*) libp->para[0].ref;
const TZigZag& obj = *dest;
result7->ref = (long) (&obj);
result7->obj.i = (long) (&obj);
return(1 || funcname || hash || result7 || libp) ;
}
/* TSplineFit */
static int G__SplineFitDict_427_0_29(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit* p = NULL;
char* gvp = (char*) G__getgvp();
int n = G__getaryconstruct();
if (n) {
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit[n];
} else {
p = new((void*) gvp) TSplineFit[n];
}
} else {
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit;
} else {
p = new((void*) gvp) TSplineFit;
}
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_30(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit* p = NULL;
char* gvp = (char*) G__getgvp();
switch (libp->paran) {
case 15:
//m: 15
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Bool_t) G__int(libp->para[10]), (Double_t) G__double(libp->para[11])
, (Double_t) G__double(libp->para[12]), (Double_t) G__double(libp->para[13])
, (Bool_t) G__int(libp->para[14]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Bool_t) G__int(libp->para[10]), (Double_t) G__double(libp->para[11])
, (Double_t) G__double(libp->para[12]), (Double_t) G__double(libp->para[13])
, (Bool_t) G__int(libp->para[14]));
}
break;
case 14:
//m: 14
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Bool_t) G__int(libp->para[10]), (Double_t) G__double(libp->para[11])
, (Double_t) G__double(libp->para[12]), (Double_t) G__double(libp->para[13]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Bool_t) G__int(libp->para[10]), (Double_t) G__double(libp->para[11])
, (Double_t) G__double(libp->para[12]), (Double_t) G__double(libp->para[13]));
}
break;
case 13:
//m: 13
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Bool_t) G__int(libp->para[10]), (Double_t) G__double(libp->para[11])
, (Double_t) G__double(libp->para[12]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Bool_t) G__int(libp->para[10]), (Double_t) G__double(libp->para[11])
, (Double_t) G__double(libp->para[12]));
}
break;
case 12:
//m: 12
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Bool_t) G__int(libp->para[10]), (Double_t) G__double(libp->para[11]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Bool_t) G__int(libp->para[10]), (Double_t) G__double(libp->para[11]));
}
break;
case 11:
//m: 11
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Bool_t) G__int(libp->para[10]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Bool_t) G__int(libp->para[10]));
}
break;
case 10:
//m: 10
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]), (Double_t) G__double(libp->para[9]));
}
break;
case 9:
//m: 9
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7])
, (Bool_t) G__int(libp->para[8]));
}
break;
case 8:
//m: 8
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]), (Double_t*) G__int(libp->para[7]));
}
break;
case 7:
//m: 7
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Int_t) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t*) G__int(libp->para[6]));
}
break;
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_31(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit* p = NULL;
char* gvp = (char*) G__getgvp();
switch (libp->paran) {
case 8:
//m: 8
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Double_t*) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Double_t) G__double(libp->para[7]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Double_t*) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Double_t) G__double(libp->para[7]));
}
break;
case 7:
//m: 7
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Double_t*) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Double_t*) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
}
break;
case 6:
//m: 6
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Double_t*) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (Double_t*) G__int(libp->para[4]), (Double_t*) G__int(libp->para[5]));
}
break;
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_32(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit* p = NULL;
char* gvp = (char*) G__getgvp();
switch (libp->paran) {
case 12:
//m: 12
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Double_t) G__double(libp->para[10]), (Bool_t) G__int(libp->para[11]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Double_t) G__double(libp->para[10]), (Bool_t) G__int(libp->para[11]));
}
break;
case 11:
//m: 11
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Double_t) G__double(libp->para[10]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Double_t) G__double(libp->para[9])
, (Double_t) G__double(libp->para[10]));
}
break;
case 10:
//m: 10
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Double_t) G__double(libp->para[9]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Double_t) G__double(libp->para[9]));
}
break;
case 9:
//m: 9
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]));
}
break;
case 8:
//m: 8
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7]));
}
break;
case 7:
//m: 7
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
}
break;
case 6:
//m: 6
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5]));
}
break;
case 5:
//m: 5
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TGraphErrors*) G__int(libp->para[4]));
}
break;
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_33(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit* p = NULL;
char* gvp = (char*) G__getgvp();
switch (libp->paran) {
case 10:
//m: 10
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Bool_t) G__int(libp->para[9]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Bool_t) G__int(libp->para[9]));
}
break;
case 9:
//m: 9
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]));
}
break;
case 8:
//m: 8
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7]));
}
break;
case 7:
//m: 7
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
}
break;
case 6:
//m: 6
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5]));
}
break;
case 5:
//m: 5
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH1D*) G__int(libp->para[4]));
}
break;
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_34(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit* p = NULL;
char* gvp = (char*) G__getgvp();
switch (libp->paran) {
case 8:
//m: 8
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7]));
} else {
p = new((void*) gvp) TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7]));
}
break;
case 7:
//m: 7
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
} else {
p = new((void*) gvp) TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
}
break;
case 6:
//m: 6
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Bool_t) G__int(libp->para[5]));
} else {
p = new((void*) gvp) TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]), (Bool_t) G__int(libp->para[5]));
}
break;
case 5:
//m: 5
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]));
} else {
p = new((void*) gvp) TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3])
, (Double_t) G__double(libp->para[4]));
}
break;
case 4:
//m: 4
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3]));
} else {
p = new((void*) gvp) TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Bool_t) G__int(libp->para[3]));
}
break;
case 3:
//m: 3
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]));
} else {
p = new((void*) gvp) TSplineFit(
(TH1D*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]));
}
break;
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_35(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit* p = NULL;
char* gvp = (char*) G__getgvp();
switch (libp->paran) {
case 10:
//m: 10
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Bool_t) G__int(libp->para[9]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Bool_t) G__int(libp->para[9]));
}
break;
case 9:
//m: 9
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]));
}
break;
case 8:
//m: 8
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7]));
}
break;
case 7:
//m: 7
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
}
break;
case 6:
//m: 6
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5]));
}
break;
case 5:
//m: 5
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH2D*) G__int(libp->para[4]));
}
break;
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_36(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit* p = NULL;
char* gvp = (char*) G__getgvp();
switch (libp->paran) {
case 10:
//m: 10
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Bool_t) G__int(libp->para[9]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]), (Bool_t) G__int(libp->para[9]));
}
break;
case 9:
//m: 9
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7])
, (Double_t) G__double(libp->para[8]));
}
break;
case 8:
//m: 8
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]), (Bool_t) G__int(libp->para[7]));
}
break;
case 7:
//m: 7
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5])
, (Double_t) G__double(libp->para[6]));
}
break;
case 6:
//m: 6
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]), (Bool_t) G__int(libp->para[5]));
}
break;
case 5:
//m: 5
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]));
} else {
p = new((void*) gvp) TSplineFit(
(Text_t*) G__int(libp->para[0]), (Text_t*) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3])
, (TH3D*) G__int(libp->para[4]));
}
break;
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_37(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit* p = NULL;
char* gvp = (char*) G__getgvp();
//m: 1
if ((gvp == (char*)G__PVOID) || (gvp == 0)) {
p = new TSplineFit(*(TSplineFit*) libp->para[0].ref);
} else {
p = new((void*) gvp) TSplineFit(*(TSplineFit*) libp->para[0].ref);
}
result7->obj.i = (long) p;
result7->ref = (long) p;
G__set_tagnum(result7,G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_38(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::AddNumbering((Int_t) G__int(libp->para[0]), *(TString*) libp->para[1].ref);
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_39(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->BelongsToFamily((Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Text_t*) G__int(libp->para[2]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_40(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 2:
G__letint(result7, 103, (long) TSplineFit::CheckHistErrors((TH1*) G__int(libp->para[0]), (Bool_t) G__int(libp->para[1])));
break;
case 1:
G__letint(result7, 103, (long) TSplineFit::CheckHistErrors((TH1*) G__int(libp->para[0])));
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_41(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 1:
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->Chi2((Bool_t) G__int(libp->para[0])));
break;
case 0:
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->Chi2());
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_43(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 1:
((TSplineFit*) G__getstructoffset())->DrawData((Option_t*) G__int(libp->para[0]));
G__setnull(result7);
break;
case 0:
((TSplineFit*) G__getstructoffset())->DrawData();
G__setnull(result7);
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_44(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 4:
((TSplineFit*) G__getstructoffset())->DrawFit((Option_t*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]), (Int_t) G__int(libp->para[3]));
G__setnull(result7);
break;
case 3:
((TSplineFit*) G__getstructoffset())->DrawFit((Option_t*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2]));
G__setnull(result7);
break;
case 2:
((TSplineFit*) G__getstructoffset())->DrawFit((Option_t*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1]));
G__setnull(result7);
break;
case 1:
((TSplineFit*) G__getstructoffset())->DrawFit((Option_t*) G__int(libp->para[0]));
G__setnull(result7);
break;
case 0:
((TSplineFit*) G__getstructoffset())->DrawFit();
G__setnull(result7);
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_45(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::DrawFitsInCollection();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_46(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 1:
TSplineFit::DrawFitsInFile((Int_t) G__int(libp->para[0]));
G__setnull(result7);
break;
case 0:
TSplineFit::DrawFitsInFile();
G__setnull(result7);
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_47(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 2:
((TSplineFit*) G__getstructoffset())->DrawHere((Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1]));
G__setnull(result7);
break;
case 1:
((TSplineFit*) G__getstructoffset())->DrawHere((Double_t) G__double(libp->para[0]));
G__setnull(result7);
break;
case 0:
((TSplineFit*) G__getstructoffset())->DrawHere();
G__setnull(result7);
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_48(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 1:
((TSplineFit*) G__getstructoffset())->DrawHisto((Option_t*) G__int(libp->para[0]));
G__setnull(result7);
break;
case 0:
((TSplineFit*) G__getstructoffset())->DrawHisto();
G__setnull(result7);
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_49(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::DrawNextInCollection();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_50(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->ErrorsFromFit();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_51(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 3:
((TSplineFit*) G__getstructoffset())->FillGraphs((Int_t) G__int(libp->para[0]), (Color_t) G__int(libp->para[1])
, (Style_t) G__int(libp->para[2]));
G__setnull(result7);
break;
case 2:
((TSplineFit*) G__getstructoffset())->FillGraphs((Int_t) G__int(libp->para[0]), (Color_t) G__int(libp->para[1]));
G__setnull(result7);
break;
case 1:
((TSplineFit*) G__getstructoffset())->FillGraphs((Int_t) G__int(libp->para[0]));
G__setnull(result7);
break;
case 0:
((TSplineFit*) G__getstructoffset())->FillGraphs();
G__setnull(result7);
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_52(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 3:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->FillH2D3D((Int_t) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2])));
break;
case 2:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->FillH2D3D((Int_t) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])));
break;
case 1:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->FillH2D3D((Int_t) G__int(libp->para[0])));
break;
case 0:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->FillH2D3D());
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_53(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 3:
G__letint(result7, 85, (long) TSplineFit::FindFit((const Text_t*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Bool_t) G__int(libp->para[2])));
break;
case 2:
G__letint(result7, 85, (long) TSplineFit::FindFit((const Text_t*) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])));
break;
case 1:
G__letint(result7, 85, (long) TSplineFit::FindFit((const Text_t*) G__int(libp->para[0])));
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_54(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) ((TSplineFit*) G__getstructoffset())->FindFirstInFamily(*(Int_t*) G__Intref(&libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_55(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) TSplineFit::FindFirstInFamily((const Text_t*) G__int(libp->para[0]), *(Int_t*) G__Intref(&libp->para[1])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_56(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) TSplineFit::FindFitInFamily((Int_t) G__int(libp->para[0]), (Int_t) G__int(libp->para[1])
, (Int_t) G__int(libp->para[2])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_57(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TSplineFit*) G__getstructoffset())->GetCategory());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_58(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->GetCst());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_59(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->GetDataFromHist((Double_t) G__double(libp->para[0]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_60(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) ((const TSplineFit*) G__getstructoffset())->GetDate());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_61(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) ((const TSplineFit*) G__getstructoffset())->GetFamilyName());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_62(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) ((TSplineFit*) G__getstructoffset())->GetHistGen());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_63(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) ((TSplineFit*) G__getstructoffset())->GetHistShow());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_64(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((TSplineFit*) G__getstructoffset())->GetKindOfFit());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_65(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TSplineFit*) G__getstructoffset())->GetLowBound(*(Double_t*) G__Doubleref(&libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_66(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) ((const TSplineFit*) G__getstructoffset())->GetMacro());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_67(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->GetMeasErr((Int_t) G__int(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_68(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->GetMeasT((Int_t) G__int(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_69(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->GetMeasV((Int_t) G__int(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_70(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TSplineFit*) G__getstructoffset())->GetMemoryReduced());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_71(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) ((const TSplineFit*) G__getstructoffset())->GetMultiGraph());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_72(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TSplineFit*) G__getstructoffset())->GetNbOfMeas());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_73(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TSplineFit*) G__getstructoffset())->GetNbOfMeasLast());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_74(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TSplineFit*) G__getstructoffset())->GetNbOfMeasSpline());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_75(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TSplineFit*) G__getstructoffset())->GetNbOfSplines());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_76(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->GetParameter());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_77(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) ((TSplineFit*) G__getstructoffset())->GetParameterDef());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_78(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TSplineFit*) G__getstructoffset())->GetPosInFamily());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_79(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) ((const TSplineFit*) G__getstructoffset())->GetProvidedName());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_80(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->GetRandom());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_81(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 3:
G__letdouble(result7, 100, (double) ((TSplineFit*) G__getstructoffset())->GetRandom((Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Bool_t) G__int(libp->para[2])));
break;
case 2:
G__letdouble(result7, 100, (double) ((TSplineFit*) G__getstructoffset())->GetRandom((Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1])));
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_82(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->GetSlope());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_83(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) ((const TSplineFit*) G__getstructoffset())->GetSource());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_84(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TSplineFit*) G__getstructoffset())->GetSpline((Int_t) G__int(libp->para[0]), *(Double_t*) G__Doubleref(&libp->para[1])
, *(Double_t*) G__Doubleref(&libp->para[2]), *(Double_t*) G__Doubleref(&libp->para[3])
, *(Double_t*) G__Doubleref(&libp->para[4])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_85(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TSplineFit*) G__getstructoffset())->GetSpline((Double_t) G__double(libp->para[0]), *(Double_t*) G__Doubleref(&libp->para[1])
, *(Double_t*) G__Doubleref(&libp->para[2]), *(Double_t*) G__Doubleref(&libp->para[3])
, *(Double_t*) G__Doubleref(&libp->para[4])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_86(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TSplineFit*) G__getstructoffset())->GetSplineNN((Int_t) G__int(libp->para[0]), *(Double_t*) G__Doubleref(&libp->para[1])
, *(Double_t*) G__Doubleref(&libp->para[2]), *(Double_t*) G__Doubleref(&libp->para[3])
, *(Double_t*) G__Doubleref(&libp->para[4])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_87(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TSplineFit*) G__getstructoffset())->GetSplineNN((Double_t) G__double(libp->para[0]), *(Double_t*) G__Doubleref(&libp->para[1])
, *(Double_t*) G__Doubleref(&libp->para[2]), *(Double_t*) G__Doubleref(&libp->para[3])
, *(Double_t*) G__Doubleref(&libp->para[4])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_88(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TSplineFit*) G__getstructoffset())->GetUpBound(*(Double_t*) G__Doubleref(&libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_89(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TSplineFit*) G__getstructoffset())->GetUseForRandom());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_90(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) ((const TSplineFit*) G__getstructoffset())->GetVLabel());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_91(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) ((const TSplineFit*) G__getstructoffset())->GetXLabel());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_92(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->GetXLowInterval((Int_t) G__int(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_93(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->GetXmax());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_94(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->GetXmin());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_95(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->GetXUpInterval((Int_t) G__int(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_96(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) ((const TSplineFit*) G__getstructoffset())->GetYLabel());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_97(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) ((const TSplineFit*) G__getstructoffset())->GetZLabel());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_98(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::InitRef();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_99(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::InitStatic();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_100(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::InitTwoPad();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_101(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((TSplineFit*) G__getstructoffset())->Integral((Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_103(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TSplineFit*) G__getstructoffset())->IsInCollection());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_104(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) TSplineFit::IsInCollection((TSplineFit*) G__int(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_106(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) ((const TSplineFit*) G__getstructoffset())->LoadFamily());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_107(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) TSplineFit::LoadFamily((const Text_t*) G__int(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_108(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((const TSplineFit*) G__getstructoffset())->MinMax(*(Bool_t*) G__Boolref(&libp->para[0]), *(Double_t*) G__Doubleref(&libp->para[1])
, *(Double_t*) G__Doubleref(&libp->para[2]), *(Bool_t*) G__Boolref(&libp->para[3])
, *(Double_t*) G__Doubleref(&libp->para[4]), *(Double_t*) G__Doubleref(&libp->para[5]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_109(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::MultinomialAsWeight((TH1*) G__int(libp->para[0]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_110(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 1:
TSplineFit::NameFile((const char*) G__int(libp->para[0]));
G__setnull(result7);
break;
case 0:
TSplineFit::NameFile();
G__setnull(result7);
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_111(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::NameProg((const char*) G__int(libp->para[0]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_112(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::NameWeb((const char*) G__int(libp->para[0]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_113(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 1:
G__letint(result7, 103, (long) TSplineFit::OrderFile((Bool_t) G__int(libp->para[0])));
break;
case 0:
G__letint(result7, 103, (long) TSplineFit::OrderFile());
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_114(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((TSplineFit*) G__getstructoffset())->Pedestal((Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_115(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->Print();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_116(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::Purge();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_117(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::PurgeStatic();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_118(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 1:
G__letint(result7, 105, (long) ((TSplineFit*) G__getstructoffset())->RedoFit((Bool_t) G__int(libp->para[0])));
break;
case 0:
G__letint(result7, 105, (long) ((TSplineFit*) G__getstructoffset())->RedoFit());
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_119(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->ReduceMemory();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_120(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::RemoveDisplay();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_121(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 2:
G__letint(result7, 103, (long) TSplineFit::RemoveFitFromFile((Text_t*) G__int(libp->para[0]), (Bool_t) G__int(libp->para[1])));
break;
case 1:
G__letint(result7, 103, (long) TSplineFit::RemoveFitFromFile((Text_t*) G__int(libp->para[0])));
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_122(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->SetDefaultLabels();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_123(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->SetMacro((Text_t*) G__int(libp->para[0]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_124(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->SetMeasErr((Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_125(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->SetMeasX((Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_126(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->SetMeasY((Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_127(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->SetParameter((Double_t) G__double(libp->para[0]), (Text_t*) G__int(libp->para[1]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_128(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->SetSource((Text_t*) G__int(libp->para[0]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_129(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->SetVLabel((Text_t*) G__int(libp->para[0]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_130(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->SetXLabel((Text_t*) G__int(libp->para[0]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_131(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->SetYLabel((Text_t*) G__int(libp->para[0]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_132(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->SetZLabel((Text_t*) G__int(libp->para[0]));
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_133(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::ShowFitsInCollection();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_134(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::ShowFitsInFile();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_135(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((const TSplineFit*) G__getstructoffset())->ShowRandom();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_136(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 5:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->SolveLeft(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])
, (Bool_t) G__int(libp->para[2]), (Double_t) G__double(libp->para[3])
, (Double_t) G__double(libp->para[4])));
break;
case 4:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->SolveLeft(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])
, (Bool_t) G__int(libp->para[2]), (Double_t) G__double(libp->para[3])));
break;
case 3:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->SolveLeft(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])
, (Bool_t) G__int(libp->para[2])));
break;
case 2:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->SolveLeft(*(Double_t*) G__Doubleref(&libp->para[0]), (Double_t) G__double(libp->para[1])));
break;
case 1:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->SolveLeft(*(Double_t*) G__Doubleref(&libp->para[0])));
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_137(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::SortCollection();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_138(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 1:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->UpdateFile((Bool_t) G__int(libp->para[0])));
break;
case 0:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->UpdateFile());
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_139(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
switch (libp->paran) {
case 1:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->UseForRandom((Bool_t) G__int(libp->para[0])));
break;
case 0:
G__letint(result7, 103, (long) ((TSplineFit*) G__getstructoffset())->UseForRandom());
break;
}
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_140(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->V((Double_t) G__double(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_141(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->V((Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_142(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((TSplineFit*) G__getstructoffset())->V((Double_t) G__double(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_143(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((TSplineFit*) G__getstructoffset())->V((Int_t) G__int(libp->para[0]), (Double_t) G__double(libp->para[1])
, (Double_t) G__double(libp->para[2])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_144(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 103, (long) ((const TSplineFit*) G__getstructoffset())->VerifyNotInFile());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_145(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::WriteCollection();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_146(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->XNorm((Double_t) G__double(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_147(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) TSplineFit::XpowerM((Double_t) G__double(libp->para[0]), (Int_t) G__int(libp->para[1])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_148(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letdouble(result7, 100, (double) ((const TSplineFit*) G__getstructoffset())->XUser((Double_t) G__double(libp->para[0])));
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_149(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 85, (long) TSplineFit::Class());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_150(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TSplineFit::Class_Name());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_151(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 115, (long) TSplineFit::Class_Version());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_152(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit::Dictionary();
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_156(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
((TSplineFit*) G__getstructoffset())->StreamerNVirtual(*(TBuffer*) libp->para[0].ref);
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_157(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TSplineFit::DeclFileName());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_158(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) TSplineFit::ImplFileLine());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_159(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 67, (long) TSplineFit::ImplFileName());
return(1 || funcname || hash || result7 || libp) ;
}
static int G__SplineFitDict_427_0_160(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
G__letint(result7, 105, (long) TSplineFit::DeclFileLine());
return(1 || funcname || hash || result7 || libp) ;
}
// automatic destructor
typedef TSplineFit G__TTSplineFit;
static int G__SplineFitDict_427_0_161(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
char* gvp = (char*) G__getgvp();
long soff = G__getstructoffset();
int n = G__getaryconstruct();
//
//has_a_delete: 1
//has_own_delete1arg: 0
//has_own_delete2arg: 0
//
if (!soff) {
return(1);
}
if (n) {
if (gvp == (char*)G__PVOID) {
delete[] (TSplineFit*) soff;
} else {
G__setgvp((long) G__PVOID);
for (int i = n - 1; i >= 0; --i) {
((TSplineFit*) (soff+(sizeof(TSplineFit)*i)))->~G__TTSplineFit();
}
G__setgvp((long)gvp);
}
} else {
if (gvp == (char*)G__PVOID) {
delete (TSplineFit*) soff;
} else {
G__setgvp((long) G__PVOID);
((TSplineFit*) (soff))->~G__TTSplineFit();
G__setgvp((long)gvp);
}
}
G__setnull(result7);
return(1 || funcname || hash || result7 || libp) ;
}
// automatic assignment operator
static int G__SplineFitDict_427_0_162(G__value* result7, G__CONST char* funcname, struct G__param* libp, int hash)
{
TSplineFit* dest = (TSplineFit*) G__getstructoffset();
*dest = *(TSplineFit*) libp->para[0].ref;
const TSplineFit& obj = *dest;
result7->ref = (long) (&obj);
result7->obj.i = (long) (&obj);
return(1 || funcname || hash || result7 || libp) ;
}
/* Setting up global function */
/*********************************************************
* Member function Stub
*********************************************************/
/* TPoly3 */
/* TBandedLE */
/* TZigZag */
/* TSplineFit */
/*********************************************************
* Global function Stub
*********************************************************/
/*********************************************************
* Get size of pointer to member function
*********************************************************/
class G__Sizep2memfuncSplineFitDict {
public:
G__Sizep2memfuncSplineFitDict(): p(&G__Sizep2memfuncSplineFitDict::sizep2memfunc) {}
size_t sizep2memfunc() { return(sizeof(p)); }
private:
size_t (G__Sizep2memfuncSplineFitDict::*p)();
};
size_t G__get_sizep2memfuncSplineFitDict()
{
G__Sizep2memfuncSplineFitDict a;
G__setsizep2memfunc((int)a.sizep2memfunc());
return((size_t)a.sizep2memfunc());
}
/*********************************************************
* virtual base class offset calculation interface
*********************************************************/
/* Setting up class inheritance */
/*********************************************************
* Inheritance information setup/
*********************************************************/
extern "C" void G__cpp_setup_inheritanceSplineFitDict() {
/* Setting up class inheritance */
if(0==G__getnumbaseclass(G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3))) {
TPoly3 *G__Lderived;
G__Lderived=(TPoly3*)0x1000;
{
TObject *G__Lpbase=(TObject*)G__Lderived;
G__inheritance_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3),G__get_linked_tagnum(&G__SplineFitDictLN_TObject),(long)G__Lpbase-(long)G__Lderived,1,1);
}
}
if(0==G__getnumbaseclass(G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE))) {
TBandedLE *G__Lderived;
G__Lderived=(TBandedLE*)0x1000;
{
TObject *G__Lpbase=(TObject*)G__Lderived;
G__inheritance_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE),G__get_linked_tagnum(&G__SplineFitDictLN_TObject),(long)G__Lpbase-(long)G__Lderived,1,1);
}
}
if(0==G__getnumbaseclass(G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag))) {
TZigZag *G__Lderived;
G__Lderived=(TZigZag*)0x1000;
{
TObject *G__Lpbase=(TObject*)G__Lderived;
G__inheritance_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag),G__get_linked_tagnum(&G__SplineFitDictLN_TObject),(long)G__Lpbase-(long)G__Lderived,1,1);
}
}
if(0==G__getnumbaseclass(G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit))) {
TSplineFit *G__Lderived;
G__Lderived=(TSplineFit*)0x1000;
{
TNamed *G__Lpbase=(TNamed*)G__Lderived;
G__inheritance_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit),G__get_linked_tagnum(&G__SplineFitDictLN_TNamed),(long)G__Lpbase-(long)G__Lderived,1,1);
}
{
TObject *G__Lpbase=(TObject*)G__Lderived;
G__inheritance_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit),G__get_linked_tagnum(&G__SplineFitDictLN_TObject),(long)G__Lpbase-(long)G__Lderived,1,0);
}
}
}
/*********************************************************
* typedef information setup/
*********************************************************/
extern "C" void G__cpp_setup_typetableSplineFitDict() {
/* Setting up typedef entry */
G__search_typename2("Short_t",115,-1,0,-1);
G__setnewtype(-1,"Signed Short integer 2 bytes (short)",0);
G__search_typename2("Int_t",105,-1,0,-1);
G__setnewtype(-1,"Signed integer 4 bytes (int)",0);
G__search_typename2("Double_t",100,-1,0,-1);
G__setnewtype(-1,"Double 8 bytes",0);
G__search_typename2("Text_t",99,-1,0,-1);
G__setnewtype(-1,"General string (char)",0);
G__search_typename2("Bool_t",103,-1,0,-1);
G__setnewtype(-1,"Boolean (0=false, 1=true) (bool)",0);
G__search_typename2("Version_t",115,-1,0,-1);
G__setnewtype(-1,"Class version identifier (short)",0);
G__search_typename2("Option_t",99,-1,256,-1);
G__setnewtype(-1,"Option string (const char)",0);
G__search_typename2("Style_t",115,-1,0,-1);
G__setnewtype(-1,"Style number (short)",0);
G__search_typename2("Color_t",115,-1,0,-1);
G__setnewtype(-1,"Color number (short)",0);
G__search_typename2("vector<ROOT::TSchemaHelper>",117,G__get_linked_tagnum(&G__SplineFitDictLN_vectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("reverse_iterator<const_iterator>",117,G__get_linked_tagnum(&G__SplineFitDictLN_reverse_iteratorlEvectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgRcLcLiteratorgR),0,G__get_linked_tagnum(&G__SplineFitDictLN_vectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgR));
G__setnewtype(-1,NULL,0);
G__search_typename2("reverse_iterator<iterator>",117,G__get_linked_tagnum(&G__SplineFitDictLN_reverse_iteratorlEvectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgRcLcLiteratorgR),0,G__get_linked_tagnum(&G__SplineFitDictLN_vectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgR));
G__setnewtype(-1,NULL,0);
G__search_typename2("vector<TVirtualArray*>",117,G__get_linked_tagnum(&G__SplineFitDictLN_vectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("reverse_iterator<const_iterator>",117,G__get_linked_tagnum(&G__SplineFitDictLN_reverse_iteratorlEvectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgRcLcLiteratorgR),0,G__get_linked_tagnum(&G__SplineFitDictLN_vectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgR));
G__setnewtype(-1,NULL,0);
G__search_typename2("reverse_iterator<iterator>",117,G__get_linked_tagnum(&G__SplineFitDictLN_reverse_iteratorlEvectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgRcLcLiteratorgR),0,G__get_linked_tagnum(&G__SplineFitDictLN_vectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgR));
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTBase<Float_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTBaselEfloatgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTBase<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTBaselEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TVectorT<Float_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TVectorTlEfloatgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TVectorT<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TVectorTlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixT<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixD",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTRow_const<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTRow_constlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTColumn_const<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTColumn_constlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTDiag_const<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTDiag_constlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTFlat_const<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTFlat_constlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTSub_const<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTSub_constlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTSparseRow_const<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTSparseRow_constlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTSparseDiag_const<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTSparseDiag_constlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTRow<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTRowlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTColumn<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTColumnlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTDiag<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTDiaglEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTFlat<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTFlatlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTSub<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTSublEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTSparseRow<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTSparseRowlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTSparseDiag<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTSparseDiaglEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TElementActionT<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TElementActionTlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TElementPosActionT<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TElementPosActionTlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTSym<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTSymlEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("TMatrixTSparse<Double_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTSparselEdoublegR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("iterator<std::bidirectional_iterator_tag,TObject*,std::ptrdiff_t,const TObject**,const TObject*&>",117,G__get_linked_tagnum(&G__SplineFitDictLN_iteratorlEbidirectional_iterator_tagcOTObjectmUcOlongcOconstsPTObjectmUmUcOconstsPTObjectmUaNgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("iterator<bidirectional_iterator_tag,TObject*,std::ptrdiff_t,const TObject**,const TObject*&>",117,G__get_linked_tagnum(&G__SplineFitDictLN_iteratorlEbidirectional_iterator_tagcOTObjectmUcOlongcOconstsPTObjectmUmUcOconstsPTObjectmUaNgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("iterator<bidirectional_iterator_tag,TObject*>",117,G__get_linked_tagnum(&G__SplineFitDictLN_iteratorlEbidirectional_iterator_tagcOTObjectmUcOlongcOconstsPTObjectmUmUcOconstsPTObjectmUaNgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("iterator<bidirectional_iterator_tag,TObject*,long>",117,G__get_linked_tagnum(&G__SplineFitDictLN_iteratorlEbidirectional_iterator_tagcOTObjectmUcOlongcOconstsPTObjectmUmUcOconstsPTObjectmUaNgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("iterator<bidirectional_iterator_tag,TObject*,long,const TObject**>",117,G__get_linked_tagnum(&G__SplineFitDictLN_iteratorlEbidirectional_iterator_tagcOTObjectmUcOlongcOconstsPTObjectmUmUcOconstsPTObjectmUaNgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("pair<UInt_t,Int_t>",117,G__get_linked_tagnum(&G__SplineFitDictLN_pairlEunsignedsPintcOintgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("vector<std::pair<UInt_t,Int_t> >",117,G__get_linked_tagnum(&G__SplineFitDictLN_vectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("vector<pair<UInt_t,Int_t> >",117,G__get_linked_tagnum(&G__SplineFitDictLN_vectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("reverse_iterator<const_iterator>",117,G__get_linked_tagnum(&G__SplineFitDictLN_reverse_iteratorlEvectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgRcLcLiteratorgR),0,G__get_linked_tagnum(&G__SplineFitDictLN_vectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgR));
G__setnewtype(-1,NULL,0);
G__search_typename2("reverse_iterator<iterator>",117,G__get_linked_tagnum(&G__SplineFitDictLN_reverse_iteratorlEvectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgRcLcLiteratorgR),0,G__get_linked_tagnum(&G__SplineFitDictLN_vectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgR));
G__setnewtype(-1,NULL,0);
G__search_typename2("vector<pair<unsigned int,int> >",117,G__get_linked_tagnum(&G__SplineFitDictLN_vectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("map<std::string,TObjArray*>",117,G__get_linked_tagnum(&G__SplineFitDictLN_maplEstringcOTObjArraymUcOlesslEstringgRcOallocatorlEpairlEconstsPstringcOTObjArraymUgRsPgRsPgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("map<string,TObjArray*>",117,G__get_linked_tagnum(&G__SplineFitDictLN_maplEstringcOTObjArraymUcOlesslEstringgRcOallocatorlEpairlEconstsPstringcOTObjArraymUgRsPgRsPgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("map<string,TObjArray*>",117,G__get_linked_tagnum(&G__SplineFitDictLN_maplEstringcOTObjArraymUcOlesslEstringgRcOallocatorlEpairlEconstsPstringcOTObjArraymUgRsPgRsPgR),0,-1);
G__setnewtype(-1,NULL,0);
G__search_typename2("map<string,TObjArray*,less<string> >",117,G__get_linked_tagnum(&G__SplineFitDictLN_maplEstringcOTObjArraymUcOlesslEstringgRcOallocatorlEpairlEconstsPstringcOTObjArraymUgRsPgRsPgR),0,-1);
G__setnewtype(-1,NULL,0);
}
/*********************************************************
* Data Member information setup/
*********************************************************/
/* Setting up class,struct,union tag member variable */
/* TPoly3 */
static void G__setup_memvarTPoly3(void) {
G__tag_memvar_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3));
{ TPoly3 *p; p=(TPoly3*)0x1000; if (p) { }
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fA[4]=",0,"Coefficients of the polynom");
G__memvar_setup((void*)((long)(&p->fN)-(long)(p)),115,0,0,-1,G__defined_typename("Short_t"),-1,1,"fN=",0,"! True degree of polynom. -1 if not solved!");
G__memvar_setup((void*)((long)(&p->fComp)-(long)(p)),103,0,0,-1,G__defined_typename("Bool_t"),-1,1,"fComp=",0,"! True if there are 2 complex solutions");
G__memvar_setup((void*)((long)(&p->fY0)-(long)(p)),100,0,0,-1,G__defined_typename("Double_t"),-1,1,"fY0=",0,"! Value of y0 in y0 = fA[0] + fA[1]*x + fA[2]*x^2 + fA[3]*x^3 for which problem was solved");
G__memvar_setup((void*)((long)(&p->fX1)-(long)(p)),100,0,0,-1,G__defined_typename("Double_t"),-1,1,"fX1=",0,"! First solution, always real");
G__memvar_setup((void*)((long)(&p->fX2)-(long)(p)),100,0,0,-1,G__defined_typename("Double_t"),-1,1,"fX2=",0,"! 2nd solution, if real. Else real part of second complex solution");
G__memvar_setup((void*)((long)(&p->fX3)-(long)(p)),100,0,0,-1,G__defined_typename("Double_t"),-1,1,"fX3=",0,"! 3rd solution, if real. Else im part of 2nd solution or minus im part of 3rd solution");
G__memvar_setup((void*)((long)(&p->fMin)-(long)(p)),103,0,0,-1,G__defined_typename("Bool_t"),-1,1,"fMin=",0,"! True if there is a minimum");
G__memvar_setup((void*)((long)(&p->fXMin)-(long)(p)),100,0,0,-1,G__defined_typename("Double_t"),-1,1,"fXMin=",0,"! Value of x at minimum, if any");
G__memvar_setup((void*)((long)(&p->fYMin)-(long)(p)),100,0,0,-1,G__defined_typename("Double_t"),-1,1,"fYMin=",0,"! Value of y at minimum, if any");
G__memvar_setup((void*)((long)(&p->fMax)-(long)(p)),103,0,0,-1,G__defined_typename("Bool_t"),-1,1,"fMax=",0,"! True if there is a maximum");
G__memvar_setup((void*)((long)(&p->fXMax)-(long)(p)),100,0,0,-1,G__defined_typename("Double_t"),-1,1,"fXMax=",0,"! Value of x at maximum, if any");
G__memvar_setup((void*)((long)(&p->fYMax)-(long)(p)),100,0,0,-1,G__defined_typename("Double_t"),-1,1,"fYMax=",0,"! Value of y at maximum, if any");
G__memvar_setup((void*)((long)(&p->fInfl)-(long)(p)),103,0,0,-1,G__defined_typename("Bool_t"),-1,1,"fInfl=",0,"! True if there is an inflection point");
G__memvar_setup((void*)((long)(&p->fXInfl)-(long)(p)),100,0,0,-1,G__defined_typename("Double_t"),-1,1,"fXInfl=",0,"! Value of x at inflexion point");
G__memvar_setup((void*)((long)(&p->fYInfl)-(long)(p)),100,0,0,-1,G__defined_typename("Double_t"),-1,1,"fYInfl=",0,"! Value of y at inflexion point");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TClass),G__defined_typename("atomic_TClass_ptr"),-2,4,"fgIsA=",0,(char*)NULL);
}
G__tag_memvar_reset();
}
/* TBandedLE */
static void G__setup_memvarTBandedLE(void) {
G__tag_memvar_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE));
{ TBandedLE *p; p=(TBandedLE*)0x1000; if (p) { }
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fF=",0,"0 : everything ok. | -1 : the matrix was singular | -2 : the provided arguments of the constructor were bad");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fN=",0,"Number of equations");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fM=",0,"Band parameter. Band size is 2*fM + 1;");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fK=",0,"Number of right-hand sides (columns) in matrix fB");
G__memvar_setup((void*)0,103,0,0,-1,G__defined_typename("Bool_t"),-1,2,"fOwnA=",0,"! True if \"this\" is owner of fA: for instance when \"this\" read from file");
G__memvar_setup((void*)0,103,0,0,-1,G__defined_typename("Bool_t"),-1,2,"fOwnB=",0,"! True if \"this\" is owner of fB: for instance when \"this\" read from file or fB has not been provided by the user");
G__memvar_setup((void*)((long)(&p->fA)-(long)(p)),85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTlEdoublegR),G__defined_typename("TMatrixD"),-1,1,"fA=",0,"User provided matrix A. Remains untouched.");
G__memvar_setup((void*)((long)(&p->fB)-(long)(p)),85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTlEdoublegR),G__defined_typename("TMatrixD"),-1,1,"fB=",0,"User provided matrix B. Remains untouched");
G__memvar_setup((void*)((long)(&p->fX)-(long)(p)),117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTlEdoublegR),G__defined_typename("TMatrixD"),-1,1,"fX=",0,"Solution of the problem");
G__memvar_setup((void*)((long)(&p->fV)-(long)(p)),117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TVectorTlEdoublegR),G__defined_typename("TVectorD"),-1,1,"fV=",0,"Solution of the problem in case fK==1");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TClass),G__defined_typename("atomic_TClass_ptr"),-2,4,"fgIsA=",0,(char*)NULL);
}
G__tag_memvar_reset();
}
/* TZigZag */
static void G__setup_memvarTZigZag(void) {
G__tag_memvar_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag));
{ TZigZag *p; p=(TZigZag*)0x1000; if (p) { }
G__memvar_setup((void*)0,115,0,0,-1,G__defined_typename("Short_t"),-1,2,"fDim=",0,"dimension: 1,2 or 3!");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fNx=",0,"Nb. of points along x");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fNy=",0,"Nb. of points along y");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fNz=",0,"Nb. of points along z");
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fXmin=",0,"low bound in x");
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fYmin=",0,"low bound in y");
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fZmin=",0,"low bound in z");
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fXmax=",0,"up bound in x");
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fYmax=",0,"up bound in y");
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fZmax=",0,"up bound in z");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TClass),G__defined_typename("atomic_TClass_ptr"),-2,4,"fgIsA=",0,(char*)NULL);
}
G__tag_memvar_reset();
}
/* TSplineFit */
static void G__setup_memvarTSplineFit(void) {
G__tag_memvar_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit));
{ TSplineFit *p; p=(TSplineFit*)0x1000; if (p) { }
G__memvar_setup((void*)0,105,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_KindOfFit),-1,-1,2,"fType=",0,"Type of fit or interpolation");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fCat=",0,"Category to which this spline fit belongs (arbitrary)");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fNbInFamily=",0,"-1 if fit not in a family, 0<=fFamylyNb<n if n elements in the family");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fM=",0,"Number of measurements (xi,yi,si)");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fMi=",0,"Number of measurements (xi,yi,si) per spline (or per sub-interval)");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fMl=",0,"Number of measurements (xi,yi,si) for the last spline");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fN=",0,"Number of splines (or sub-intervals)");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-1,2,"fNs2=",0,"Biggest power of 2 less than fN;");
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fSlope=",0,"Slope of linear transformation to go to normalized x (-1,1)");
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fCst=",0,"Constant term of linear transformation to go to normalized x (-1,1)");
G__memvar_setup((void*)0,103,0,0,-1,G__defined_typename("Bool_t"),-1,2,"fBoundedLow=",0,"True if y has a lower bound");
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fLowBound=",0,"Lower bound for y");
G__memvar_setup((void*)0,103,0,0,-1,G__defined_typename("Bool_t"),-1,2,"fBoundedUp=",0,"True if y has an upper bound");
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fUpBound=",0,"High bound for y");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTlEdoublegR),G__defined_typename("TMatrixD"),-1,2,"fA=",0,"! Band matrix of the problem, in compact form. See TBandedLE");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTlEdoublegR),G__defined_typename("TMatrixD"),-1,2,"fB=",0,"! Matrix of the right-hand side of the problem");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TArrayD),-1,-1,2,"fX=",0,"solution of the problem");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TArrayD),-1,-1,2,"fKhi=",0,"fKhi(k-1) = xmin for sub-interval k. fKhi(k) = xmax for sub-interval k.");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TArrayD),-1,-1,2,"fMt=",0,"coordinate t of measurements. In case of 1D fit t==x");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TArrayD),-1,-1,2,"fMv=",0,"measured values at x");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TArrayD),-1,-1,2,"fMs=",0,"errors on y measurements");
G__memvar_setup((void*)0,103,0,0,-1,G__defined_typename("Bool_t"),-1,2,"fUseForRandom=",0,"If true, fit used to generate random numbers");
G__memvar_setup((void*)0,100,0,0,-1,G__defined_typename("Double_t"),-1,2,"fParameter=",0,"Variable or parameter associated with this fit");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TString),-1,-1,2,"fParameterDef=",0,"Definition of the parameter (the same for all members of a family)");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag),-1,-1,2,"fZigZag=",0,"For use with 2D or 3D fits");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TString),-1,-1,2,"fDate=",0,"Date of creation of this fit");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TString),-1,-1,2,"fSource=",0,"Source of the measurements");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TString),-1,-1,2,"fMacro=",0,"Name of CINT macro having produced this fit");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TString),-1,-1,2,"fXLabel=",0,"Label of the x axis");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TString),-1,-1,2,"fYLabel=",0,"Label of the y axis");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TString),-1,-1,2,"fZLabel=",0,"Label of the z axis");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TString),-1,-1,2,"fVLabel=",0,"Label of the value axis");
G__memvar_setup((void*)0,103,0,0,-1,G__defined_typename("Bool_t"),-1,2,"fMemoryReduced=",0,"Everything deleted, except the fit. In case you lack of memory");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TSpline3),-1,-1,2,"fInterpolation=",0,"! TSpline3 used in case the user asks for an interpolation, not a fit");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TH1D),-1,-1,2,"fHGenRandom=",0,"! Histogram used to get random numbers according to the fitted distribution");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TH1D),-1,-1,2,"fHShowRandom=",0,"! Histogram used to display the random numbers generated");
G__memvar_setup((void*)0,117,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TString),-1,-1,2,"fProvidedName=",0,"! Name of fProvidedH1D, kept in case user delete histo");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TF1),-1,-1,2,"fSplineFitFunc=",0,"! function given to provided histo, to show fit on histo");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TGraphErrors),-1,-1,2,"fPointsGraph=",0,"! Graph for drawing measurements");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TGraph),-1,-1,2,"fSplineGraph=",0,"! Graph for drawing fit");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TMultiGraph),-1,-1,2,"fPS=",0,"! Multi graph containing both");
G__memvar_setup((void*)0,103,0,0,-1,G__defined_typename("Bool_t"),-1,2,"f2Drestored=",0,"! True if fProvidedH2D has been restored");
G__memvar_setup((void*)0,103,0,0,-1,G__defined_typename("Bool_t"),-1,2,"f3Drestored=",0,"! True if fProvidedH3D has been restored");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TH1D),-1,-1,2,"fProvidedH1D=",0,"! Histo provided in 4th or 5th constructor. Not owned by TSplineFit");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TH2D),-1,-1,2,"fProvidedH2D=",0,"! Histo provided in 7th constructor. Not owned by TSplineFit");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TH2D),-1,-1,2,"fH2Dfit=",0,"! Histo to show the 2D fit");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TH3D),-1,-1,2,"fProvidedH3D=",0,"! Histo provided in 8th constructor. Not owned by TSplineFit");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TH3D),-1,-1,2,"fH3Dfit=",0,"! Histo to show the 3D fit");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-2,2,"fgNextDraw=",0,"Next fit to be drawn");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-2,2,"fgM=",0,"order M of band matrix fA, always equal to 6");
G__memvar_setup((void*)0,105,0,0,-1,G__defined_typename("Int_t"),-2,2,"fgU=",0,"number of unknowns for one spline, with Lagrange parameters, always equal to 7");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TArrayI),-1,-2,2,"fgCat=",0,"Array of categories");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TFile),-1,-2,2,"fgFitFile=",0,"\"Database\" file containing fits");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TTree),-1,-2,2,"fgFitTree=",0,"Tree of fits");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TBranch),-1,-2,2,"fgFitBranch=",0,"Branch of fits");
G__memvar_setup((void*)(&TSplineFit::fgFits),85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TObjArray),-1,-2,1,"fgFits=",0,"Collection of all TSplineFits");
G__memvar_setup((void*)(&TSplineFit::fgRef),85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TReference),-1,-2,1,"fgRef=",0,"References of program SplineFit");
G__memvar_setup((void*)(&TSplineFit::fgFileName),85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TString),-1,-2,1,"fgFileName=",0,"Name or TreeName of \"database\" file containing fits");
G__memvar_setup((void*)(&TSplineFit::fgNChanRand),105,0,0,-1,G__defined_typename("Int_t"),-2,1,"fgNChanRand=",0,"number of channels for the 2 histograms fHGenRandom and fHShowRandom");
G__memvar_setup((void*)(&TSplineFit::fgCounter),105,0,0,-1,G__defined_typename("Int_t"),-2,1,"fgCounter=",0,"new versus delete");
G__memvar_setup((void*)0,85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TClass),G__defined_typename("atomic_TClass_ptr"),-2,4,"fgIsA=",0,(char*)NULL);
}
G__tag_memvar_reset();
}
extern "C" void G__cpp_setup_memvarSplineFitDict() {
}
/***********************************************************
************************************************************
************************************************************
************************************************************
************************************************************
************************************************************
************************************************************
***********************************************************/
/*********************************************************
* Member function information setup for each class
*********************************************************/
static void G__setup_memfuncTPoly3(void) {
/* TPoly3 */
G__tag_memfunc_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3));
G__memfunc_setup("Init",404,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Solve2",571,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 1, 1, 2, 0, "d - 'Double_t' 0 '0.0' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Solve3",572,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 1, 1, 2, 0, "d - 'Double_t' 0 '0.0' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TPoly3",555,G__SplineFitDict_107_0_4, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3), -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TPoly3",555,G__SplineFitDict_107_0_5, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3), -1, 0, 4, 1, 1, 0,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TPoly3",555,G__SplineFitDict_107_0_6, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3), -1, 0, 1, 1, 1, 0, "D - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Degree",588,G__SplineFitDict_107_0_7, 115, -1, G__defined_typename("Short_t"), 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Extrema",726,G__SplineFitDict_107_0_8, 121, -1, -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Integral",822,G__SplineFitDict_107_0_9, 100, -1, G__defined_typename("Double_t"), 0, 2, 1, 1, 0,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Set",300,G__SplineFitDict_107_0_10, 121, -1, -1, 0, 4, 1, 1, 0,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Set",300,G__SplineFitDict_107_0_11, 121, -1, -1, 0, 1, 1, 1, 0, "D - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Solution",861,G__SplineFitDict_107_0_12, 115, -1, G__defined_typename("Short_t"), 0, 5, 1, 1, 0,
"d - 'Double_t' 1 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - - d - 'Double_t' 1 - - "
"g - 'Bool_t' 1 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Solve",521,G__SplineFitDict_107_0_13, 121, -1, -1, 0, 1, 1, 1, 0, "d - 'Double_t' 0 '0.0' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Solve",521,G__SplineFitDict_107_0_14, 115, -1, G__defined_typename("Short_t"), 0, 5, 1, 1, 0,
"d - 'Double_t' 1 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - - g - 'Bool_t' 1 - - "
"d - 'Double_t' 0 '0.0' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SolveLeft",916,G__SplineFitDict_107_0_15, 103, -1, G__defined_typename("Bool_t"), 0, 5, 1, 1, 0,
"d - 'Double_t' 1 - - d - 'Double_t' 0 '0.0' - "
"g - 'Bool_t' 0 'kFALSE' - d - 'Double_t' 0 '-1.0' - "
"d - 'Double_t' 0 '1.0' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SolveRight",1031,G__SplineFitDict_107_0_16, 103, -1, G__defined_typename("Bool_t"), 0, 5, 1, 1, 0,
"d - 'Double_t' 1 - - d - 'Double_t' 0 '0.0' - "
"g - 'Bool_t' 0 'kFALSE' - d - 'Double_t' 0 '-1.0' - "
"d - 'Double_t' 0 '1.0' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Y",89,G__SplineFitDict_107_0_17, 100, -1, G__defined_typename("Double_t"), 0, 1, 1, 1, 0, "d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Class",502,G__SplineFitDict_107_0_18, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TClass), -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (TClass* (*)())(&TPoly3::Class) ), 0);
G__memfunc_setup("Class_Name",982,G__SplineFitDict_107_0_19, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TPoly3::Class_Name) ), 0);
G__memfunc_setup("Class_Version",1339,G__SplineFitDict_107_0_20, 115, -1, G__defined_typename("Version_t"), 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (Version_t (*)())(&TPoly3::Class_Version) ), 0);
G__memfunc_setup("Dictionary",1046,G__SplineFitDict_107_0_21, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TPoly3::Dictionary) ), 0);
G__memfunc_setup("IsA",253,(G__InterfaceMethod) NULL,85, G__get_linked_tagnum(&G__SplineFitDictLN_TClass), -1, 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("ShowMembers",1132,(G__InterfaceMethod) NULL,121, -1, -1, 0, 1, 1, 1, 0, "u 'TMemberInspector' - 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("Streamer",835,(G__InterfaceMethod) NULL,121, -1, -1, 0, 1, 1, 1, 0, "u 'TBuffer' - 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("StreamerNVirtual",1656,G__SplineFitDict_107_0_25, 121, -1, -1, 0, 1, 1, 1, 0, "u 'TBuffer' - 1 - ClassDef_StreamerNVirtual_b", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("DeclFileName",1145,G__SplineFitDict_107_0_26, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TPoly3::DeclFileName) ), 0);
G__memfunc_setup("ImplFileLine",1178,G__SplineFitDict_107_0_27, 105, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (int (*)())(&TPoly3::ImplFileLine) ), 0);
G__memfunc_setup("ImplFileName",1171,G__SplineFitDict_107_0_28, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TPoly3::ImplFileName) ), 0);
G__memfunc_setup("DeclFileLine",1152,G__SplineFitDict_107_0_29, 105, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (int (*)())(&TPoly3::DeclFileLine) ), 0);
// automatic copy constructor
G__memfunc_setup("TPoly3", 555, G__SplineFitDict_107_0_30, (int) ('i'), G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3), -1, 0, 1, 1, 1, 0, "u 'TPoly3' - 11 - -", (char*) NULL, (void*) NULL, 0);
// automatic destructor
G__memfunc_setup("~TPoly3", 681, G__SplineFitDict_107_0_31, (int) ('y'), -1, -1, 0, 0, 1, 1, 0, "", (char*) NULL, (void*) NULL, 1);
// automatic assignment operator
G__memfunc_setup("operator=", 937, G__SplineFitDict_107_0_32, (int) ('u'), G__get_linked_tagnum(&G__SplineFitDictLN_TPoly3), -1, 1, 1, 1, 1, 0, "u 'TPoly3' - 11 - -", (char*) NULL, (void*) NULL, 0);
G__tag_memfunc_reset();
}
static void G__setup_memfuncTBandedLE(void) {
/* TBandedLE */
G__tag_memfunc_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE));
G__memfunc_setup("Compactify",1039,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Init",404,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TBandedLE",803,G__SplineFitDict_192_0_3, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE), -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TBandedLE",803,G__SplineFitDict_192_0_4, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE), -1, 0, 6, 1, 1, 0,
"i - 'Int_t' 0 - - i - 'Int_t' 0 - - "
"i - 'Int_t' 0 - - u 'TMatrixT<double>' 'TMatrixD' 1 - - "
"u 'TMatrixT<double>' 'TMatrixD' 1 - - g - 'Bool_t' 0 'kTRUE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TBandedLE",803,G__SplineFitDict_192_0_5, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE), -1, 0, 4, 1, 1, 0,
"u 'TMatrixT<double>' 'TMatrixD' 1 - - u 'TMatrixT<double>' 'TMatrixD' 1 - - "
"i - 'Int_t' 0 - - g - 'Bool_t' 0 'kTRUE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TBandedLE",803,G__SplineFitDict_192_0_6, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE), -1, 0, 3, 1, 1, 0,
"u 'TMatrixT<double>' 'TMatrixD' 1 - - i - 'Int_t' 0 - - "
"g - 'Bool_t' 0 'kTRUE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetfA",455,G__SplineFitDict_192_0_7, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTlEdoublegR), G__defined_typename("TMatrixD"), 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetfB",456,G__SplineFitDict_192_0_8, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TMatrixTlEdoublegR), G__defined_typename("TMatrixD"), 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetfF",460,G__SplineFitDict_192_0_9, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetfK",465,G__SplineFitDict_192_0_10, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetfM",467,G__SplineFitDict_192_0_11, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetfN",468,G__SplineFitDict_192_0_12, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Solve",521,G__SplineFitDict_192_0_13, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Verify",629,G__SplineFitDict_192_0_14, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Class",502,G__SplineFitDict_192_0_15, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TClass), -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (TClass* (*)())(&TBandedLE::Class) ), 0);
G__memfunc_setup("Class_Name",982,G__SplineFitDict_192_0_16, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TBandedLE::Class_Name) ), 0);
G__memfunc_setup("Class_Version",1339,G__SplineFitDict_192_0_17, 115, -1, G__defined_typename("Version_t"), 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (Version_t (*)())(&TBandedLE::Class_Version) ), 0);
G__memfunc_setup("Dictionary",1046,G__SplineFitDict_192_0_18, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TBandedLE::Dictionary) ), 0);
G__memfunc_setup("IsA",253,(G__InterfaceMethod) NULL,85, G__get_linked_tagnum(&G__SplineFitDictLN_TClass), -1, 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("ShowMembers",1132,(G__InterfaceMethod) NULL,121, -1, -1, 0, 1, 1, 1, 0, "u 'TMemberInspector' - 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("Streamer",835,(G__InterfaceMethod) NULL,121, -1, -1, 0, 1, 1, 1, 0, "u 'TBuffer' - 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("StreamerNVirtual",1656,G__SplineFitDict_192_0_22, 121, -1, -1, 0, 1, 1, 1, 0, "u 'TBuffer' - 1 - ClassDef_StreamerNVirtual_b", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("DeclFileName",1145,G__SplineFitDict_192_0_23, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TBandedLE::DeclFileName) ), 0);
G__memfunc_setup("ImplFileLine",1178,G__SplineFitDict_192_0_24, 105, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (int (*)())(&TBandedLE::ImplFileLine) ), 0);
G__memfunc_setup("ImplFileName",1171,G__SplineFitDict_192_0_25, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TBandedLE::ImplFileName) ), 0);
G__memfunc_setup("DeclFileLine",1152,G__SplineFitDict_192_0_26, 105, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (int (*)())(&TBandedLE::DeclFileLine) ), 0);
// automatic copy constructor
G__memfunc_setup("TBandedLE", 803, G__SplineFitDict_192_0_27, (int) ('i'), G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE), -1, 0, 1, 1, 1, 0, "u 'TBandedLE' - 11 - -", (char*) NULL, (void*) NULL, 0);
// automatic destructor
G__memfunc_setup("~TBandedLE", 929, G__SplineFitDict_192_0_28, (int) ('y'), -1, -1, 0, 0, 1, 1, 0, "", (char*) NULL, (void*) NULL, 1);
// automatic assignment operator
G__memfunc_setup("operator=", 937, G__SplineFitDict_192_0_29, (int) ('u'), G__get_linked_tagnum(&G__SplineFitDictLN_TBandedLE), -1, 1, 1, 1, 1, 0, "u 'TBandedLE' - 11 - -", (char*) NULL, (void*) NULL, 0);
G__tag_memfunc_reset();
}
static void G__setup_memfuncTZigZag(void) {
/* TZigZag */
G__tag_memfunc_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag));
G__memfunc_setup("Init",404,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TZigZag",672,G__SplineFitDict_196_0_2, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag), -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TZigZag",672,G__SplineFitDict_196_0_3, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag), -1, 0, 3, 1, 1, 0,
"i - 'Int_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TZigZag",672,G__SplineFitDict_196_0_4, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag), -1, 0, 6, 1, 1, 0,
"i - 'Int_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - i - 'Int_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TZigZag",672,G__SplineFitDict_196_0_5, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag), -1, 0, 9, 1, 1, 0,
"i - 'Int_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - i - 'Int_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"i - 'Int_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TZigZag",672,G__SplineFitDict_196_0_6, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag), -1, 0, 1, 1, 1, 0, "u 'TZigZag' - 11 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetNx",486,G__SplineFitDict_196_0_7, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetNy",487,G__SplineFitDict_196_0_8, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetNz",488,G__SplineFitDict_196_0_9, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetXmin",700,G__SplineFitDict_196_0_10, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetXmax",702,G__SplineFitDict_196_0_11, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetYmin",701,G__SplineFitDict_196_0_12, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetYmax",703,G__SplineFitDict_196_0_13, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetZmin",702,G__SplineFitDict_196_0_14, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetZmax",704,G__SplineFitDict_196_0_15, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("IsInside",792,G__SplineFitDict_196_0_16, 103, -1, G__defined_typename("Bool_t"), 0, 10, 1, 1, 8,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("IsInside",792,G__SplineFitDict_196_0_17, 103, -1, G__defined_typename("Bool_t"), 0, 15, 1, 1, 8,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("NearestPoints",1359,G__SplineFitDict_196_0_18, 103, -1, G__defined_typename("Bool_t"), 0, 3, 1, 1, 8,
"d - 'Double_t' 0 - - u 'TArrayI' - 1 - - "
"u 'TArrayD' - 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("NearestPoints",1359,G__SplineFitDict_196_0_19, 103, -1, G__defined_typename("Bool_t"), 0, 5, 1, 1, 8,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - u 'TArrayI' - 1 - - "
"u 'TArrayD' - 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("NToZZ",453,G__SplineFitDict_196_0_20, 105, -1, G__defined_typename("Int_t"), 0, 1, 1, 1, 8, "i - 'Int_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("NToZZ",453,G__SplineFitDict_196_0_21, 105, -1, G__defined_typename("Int_t"), 0, 2, 1, 1, 8,
"i - 'Int_t' 0 - - i - 'Int_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("NToZZ",453,G__SplineFitDict_196_0_22, 105, -1, G__defined_typename("Int_t"), 0, 3, 1, 1, 8,
"i - 'Int_t' 0 - - i - 'Int_t' 0 - - "
"i - 'Int_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Order",508,G__SplineFitDict_196_0_23, 121, -1, -1, 0, 5, 1, 1, 8,
"i - 'Int_t' 0 - - u 'TArrayI' - 1 - - "
"u 'TArrayD' - 1 - - u 'TArrayD' - 1 - - "
"u 'TArrayD' - 1 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("PointsNear",1027,G__SplineFitDict_196_0_24, 103, -1, G__defined_typename("Bool_t"), 0, 5, 1, 1, 8,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 1 - - u 'TArrayD' - 1 - - "
"u 'TArrayD' - 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("T",84,G__SplineFitDict_196_0_25, 100, -1, G__defined_typename("Double_t"), 0, 1, 1, 1, 8, "i - 'Int_t' 0 - i", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TMax",378,G__SplineFitDict_196_0_26, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Class",502,G__SplineFitDict_196_0_27, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TClass), -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (TClass* (*)())(&TZigZag::Class) ), 0);
G__memfunc_setup("Class_Name",982,G__SplineFitDict_196_0_28, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TZigZag::Class_Name) ), 0);
G__memfunc_setup("Class_Version",1339,G__SplineFitDict_196_0_29, 115, -1, G__defined_typename("Version_t"), 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (Version_t (*)())(&TZigZag::Class_Version) ), 0);
G__memfunc_setup("Dictionary",1046,G__SplineFitDict_196_0_30, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TZigZag::Dictionary) ), 0);
G__memfunc_setup("IsA",253,(G__InterfaceMethod) NULL,85, G__get_linked_tagnum(&G__SplineFitDictLN_TClass), -1, 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("ShowMembers",1132,(G__InterfaceMethod) NULL,121, -1, -1, 0, 1, 1, 1, 0, "u 'TMemberInspector' - 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("Streamer",835,(G__InterfaceMethod) NULL,121, -1, -1, 0, 1, 1, 1, 0, "u 'TBuffer' - 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("StreamerNVirtual",1656,G__SplineFitDict_196_0_34, 121, -1, -1, 0, 1, 1, 1, 0, "u 'TBuffer' - 1 - ClassDef_StreamerNVirtual_b", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("DeclFileName",1145,G__SplineFitDict_196_0_35, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TZigZag::DeclFileName) ), 0);
G__memfunc_setup("ImplFileLine",1178,G__SplineFitDict_196_0_36, 105, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (int (*)())(&TZigZag::ImplFileLine) ), 0);
G__memfunc_setup("ImplFileName",1171,G__SplineFitDict_196_0_37, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TZigZag::ImplFileName) ), 0);
G__memfunc_setup("DeclFileLine",1152,G__SplineFitDict_196_0_38, 105, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (int (*)())(&TZigZag::DeclFileLine) ), 0);
// automatic destructor
G__memfunc_setup("~TZigZag", 798, G__SplineFitDict_196_0_39, (int) ('y'), -1, -1, 0, 0, 1, 1, 0, "", (char*) NULL, (void*) NULL, 1);
// automatic assignment operator
G__memfunc_setup("operator=", 937, G__SplineFitDict_196_0_40, (int) ('u'), G__get_linked_tagnum(&G__SplineFitDictLN_TZigZag), -1, 1, 1, 1, 1, 0, "u 'TZigZag' - 11 - -", (char*) NULL, (void*) NULL, 0);
G__tag_memfunc_reset();
}
static void G__setup_memfuncTSplineFit(void) {
/* TSplineFit */
G__tag_memfunc_setup(G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit));
G__memfunc_setup("AddFit",556,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 1, 3, 2, 0, "U 'TSplineFit' - 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("AddThisFit",964,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("AdjustErrors",1256,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("AdjustfgCat",1104,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 3, 2, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Alpha",486,(G__InterfaceMethod) NULL, 100, -1, G__defined_typename("Double_t"), 0, 3, 1, 2, 8,
"i - 'Int_t' 0 - - i - 'Int_t' 0 - - "
"i - 'Int_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("AlreadySeen",1101,(G__InterfaceMethod) NULL, 103, -1, G__defined_typename("Bool_t"), 0, 2, 1, 2, 8,
"u 'TString' - 1 - - u 'TString' - 1 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("ApplyLowBound",1328,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 1, 1, 2, 8, "u 'TArrayD' - 1 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Beta",380,(G__InterfaceMethod) NULL, 100, -1, G__defined_typename("Double_t"), 0, 2, 1, 2, 8,
"i - 'Int_t' 0 - - i - 'Int_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("ClearGraphs",1100,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 1, 1, 2, 0, "g - 'Bool_t' 0 'kTRUE' -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("CutLinkWithHisto",1629,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("ExtractPrefixN",1431,(G__InterfaceMethod) NULL, 103, -1, G__defined_typename("Bool_t"), 0, 1, 1, 2, 8, "u 'TString' - 1 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("ExtractPrefixT",1437,(G__InterfaceMethod) NULL, 103, -1, G__defined_typename("Bool_t"), 0, 1, 1, 2, 8, "u 'TString' - 1 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Fill",391,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("FindDate",767,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetDataFromHist",1478,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 4, 1, 2, 0,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - - U 'TH1D' - 0 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("Init",404,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("InitCatAndBounds",1578,(G__InterfaceMethod) NULL, 103, -1, G__defined_typename("Bool_t"), 0, 5, 1, 2, 0,
"i - 'Int_t' 0 - - g - 'Bool_t' 0 - - "
"d - 'Double_t' 0 - - g - 'Bool_t' 0 - - "
"d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("InitCheckBounds",1501,(G__InterfaceMethod) NULL, 103, -1, G__defined_typename("Bool_t"), 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("InitDimensions",1453,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 2, 1, 2, 0,
"i - 'Int_t' 0 - - i - 'Int_t' 0 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("InitIntervals",1356,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 2, 1, 2, 0,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("InitP",484,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Interpolation",1384,(G__InterfaceMethod) NULL, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("Interval",837,(G__InterfaceMethod) NULL, 105, -1, G__defined_typename("Int_t"), 0, 1, 1, 2, 8, "d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("MinMax",586,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 7, 1, 2, 8,
"i - 'Int_t' 0 - - g - 'Bool_t' 1 - - "
"d - 'Double_t' 1 - - d - 'Double_t' 1 - - "
"g - 'Bool_t' 1 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("Regenerate",1026,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("RestoreHisto",1259,(G__InterfaceMethod) NULL, 103, -1, G__defined_typename("Bool_t"), 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("Solve",521,(G__InterfaceMethod) NULL, 105, -1, G__defined_typename("Int_t"), 0, 1, 1, 2, 0, "g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("VerifyNT",791,(G__InterfaceMethod) NULL, 121, -1, -1, 0, 0, 1, 2, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TSplineFit",994,G__SplineFitDict_427_0_29, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TSplineFit",994,G__SplineFitDict_427_0_30, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 15, 1, 1, 0,
"C - 'Text_t' 0 - - C - 'Text_t' 0 - - "
"i - 'Int_t' 0 - - i - 'Int_t' 0 - - "
"i - 'Int_t' 0 - - D - 'Double_t' 0 - - "
"D - 'Double_t' 0 - - D - 'Double_t' 0 '0' - "
"g - 'Bool_t' 0 'kFALSE' - d - 'Double_t' 0 '0.0' - "
"g - 'Bool_t' 0 'kFALSE' - d - 'Double_t' 0 '1.0' - "
"d - 'Double_t' 0 '1.0' - d - 'Double_t' 0 '-1.0' - "
"g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TSplineFit",994,G__SplineFitDict_427_0_31, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 8, 1, 1, 0,
"C - 'Text_t' 0 - - C - 'Text_t' 0 - - "
"i - 'Int_t' 0 - - i - 'Int_t' 0 - - "
"D - 'Double_t' 0 - - D - 'Double_t' 0 - - "
"d - 'Double_t' 0 '1.0' - d - 'Double_t' 0 '-1.0' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TSplineFit",994,G__SplineFitDict_427_0_32, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 12, 1, 1, 0,
"C - 'Text_t' 0 - - C - 'Text_t' 0 - - "
"i - 'Int_t' 0 - - i - 'Int_t' 0 - - "
"U 'TGraphErrors' - 0 - - g - 'Bool_t' 0 'kFALSE' - "
"d - 'Double_t' 0 '0.0' - g - 'Bool_t' 0 'kFALSE' - "
"d - 'Double_t' 0 '1.0' - d - 'Double_t' 0 '1.0' - "
"d - 'Double_t' 0 '-1.0' - g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TSplineFit",994,G__SplineFitDict_427_0_33, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 10, 1, 1, 0,
"C - 'Text_t' 0 - - C - 'Text_t' 0 - - "
"i - 'Int_t' 0 - - i - 'Int_t' 0 - - "
"U 'TH1D' - 0 - - g - 'Bool_t' 0 'kFALSE' - "
"d - 'Double_t' 0 '0.0' - g - 'Bool_t' 0 'kFALSE' - "
"d - 'Double_t' 0 '1.0' - g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TSplineFit",994,G__SplineFitDict_427_0_34, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 8, 1, 1, 0,
"U 'TH1D' - 0 - - i - 'Int_t' 0 - - "
"i - 'Int_t' 0 - - g - 'Bool_t' 0 'kFALSE' - "
"d - 'Double_t' 0 '0.0' - g - 'Bool_t' 0 'kFALSE' - "
"d - 'Double_t' 0 '1.0' - g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TSplineFit",994,G__SplineFitDict_427_0_35, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 10, 1, 1, 0,
"C - 'Text_t' 0 - - C - 'Text_t' 0 - - "
"i - 'Int_t' 0 - - i - 'Int_t' 0 - - "
"U 'TH2D' - 0 - - g - 'Bool_t' 0 'kFALSE' - "
"d - 'Double_t' 0 '0.0' - g - 'Bool_t' 0 'kFALSE' - "
"d - 'Double_t' 0 '1.0' - g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TSplineFit",994,G__SplineFitDict_427_0_36, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 10, 1, 1, 0,
"C - 'Text_t' 0 - - C - 'Text_t' 0 - - "
"i - 'Int_t' 0 - - i - 'Int_t' 0 - - "
"U 'TH3D' - 0 - - g - 'Bool_t' 0 'kFALSE' - "
"d - 'Double_t' 0 '0.0' - g - 'Bool_t' 0 'kFALSE' - "
"d - 'Double_t' 0 '1.0' - g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("TSplineFit",994,G__SplineFitDict_427_0_37, 105, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 1, 1, 1, 0, "u 'TSplineFit' - 11 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("AddNumbering",1200,G__SplineFitDict_427_0_38, 121, -1, -1, 0, 2, 3, 1, 0,
"i - 'Int_t' 0 - - u 'TString' - 1 - -", (char*)NULL, (void*) G__func2void( (void (*)(Int_t, TString&))(&TSplineFit::AddNumbering) ), 0);
G__memfunc_setup("BelongsToFamily",1519,G__SplineFitDict_427_0_39, 121, -1, -1, 0, 3, 1, 1, 0,
"i - 'Int_t' 0 - - d - 'Double_t' 0 - - "
"C - 'Text_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("CheckHistErrors",1523,G__SplineFitDict_427_0_40, 103, -1, G__defined_typename("Bool_t"), 0, 2, 3, 1, 0,
"U 'TH1' - 0 - - g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) G__func2void( (Bool_t (*)(TH1*, Bool_t))(&TSplineFit::CheckHistErrors) ), 0);
G__memfunc_setup("Chi2",326,G__SplineFitDict_427_0_41, 100, -1, G__defined_typename("Double_t"), 0, 1, 1, 1, 8, "g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("Compare",711,(G__InterfaceMethod) NULL,105, -1, G__defined_typename("Int_t"), 0, 1, 1, 1, 8, "U 'TObject' - 10 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("DrawData",776,G__SplineFitDict_427_0_43, 121, -1, -1, 0, 1, 1, 1, 0, "C - 'Option_t' 10 '\"LEGO2\"' option", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("DrawFit",689,G__SplineFitDict_427_0_44, 121, -1, -1, 0, 4, 1, 1, 0,
"C - 'Option_t' 10 '\"LEGO2\"' option i - 'Int_t' 0 '1' - "
"i - 'Int_t' 0 '1' - i - 'Int_t' 0 '1' -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("DrawFitsInCollection",2023,G__SplineFitDict_427_0_45, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::DrawFitsInCollection) ), 0);
G__memfunc_setup("DrawFitsInFile",1371,G__SplineFitDict_427_0_46, 121, -1, -1, 0, 1, 3, 1, 0, "i - 'Int_t' 0 '0' -", (char*)NULL, (void*) G__func2void( (void (*)(Int_t))(&TSplineFit::DrawFitsInFile) ), 0);
G__memfunc_setup("DrawHere",786,G__SplineFitDict_427_0_47, 121, -1, -1, 0, 2, 1, 1, 0,
"d - 'Double_t' 0 '1.0' - d - 'Double_t' 0 '-1.0' -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("DrawHisto",917,G__SplineFitDict_427_0_48, 121, -1, -1, 0, 1, 1, 1, 0, "C - 'Option_t' 10 '\"LEGO2\"' option", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("DrawNextInCollection",2032,G__SplineFitDict_427_0_49, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::DrawNextInCollection) ), 0);
G__memfunc_setup("ErrorsFromFit",1332,G__SplineFitDict_427_0_50, 121, -1, -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("FillGraphs",1004,G__SplineFitDict_427_0_51, 121, -1, -1, 0, 3, 1, 1, 0,
"i - 'Int_t' 0 '200' - s - 'Color_t' 0 '4' - "
"s - 'Style_t' 0 '21' -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("FillH2D3D",700,G__SplineFitDict_427_0_52, 103, -1, G__defined_typename("Bool_t"), 0, 3, 1, 1, 0,
"i - 'Int_t' 0 '1' - i - 'Int_t' 0 '1' - "
"i - 'Int_t' 0 '1' -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("FindFit",676,G__SplineFitDict_427_0_53, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 3, 3, 1, 0,
"C - 'Text_t' 10 - - i - 'Int_t' 0 '-1' - "
"g - 'Bool_t' 0 'kTRUE' -", (char*)NULL, (void*) G__func2void( (TSplineFit* (*)(const Text_t*, Int_t, Bool_t))(&TSplineFit::FindFit) ), 0);
G__memfunc_setup("FindFirstInFamily",1698,G__SplineFitDict_427_0_54, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 1, 1, 1, 0, "i - 'Int_t' 1 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("FindFirstInFamily",1698,G__SplineFitDict_427_0_55, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 2, 3, 1, 0,
"C - 'Text_t' 10 - - i - 'Int_t' 1 - -", (char*)NULL, (void*) G__func2void( (TSplineFit* (*)(const Text_t*, Int_t&))(&TSplineFit::FindFirstInFamily) ), 0);
G__memfunc_setup("FindFitInFamily",1469,G__SplineFitDict_427_0_56, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 0, 3, 3, 1, 0,
"i - 'Int_t' 0 - - i - 'Int_t' 0 - - "
"i - 'Int_t' 0 - -", (char*)NULL, (void*) G__func2void( (TSplineFit* (*)(Int_t, Int_t, Int_t))(&TSplineFit::FindFitInFamily) ), 0);
G__memfunc_setup("GetCategory",1118,G__SplineFitDict_427_0_57, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetCst",586,G__SplineFitDict_427_0_58, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetDataFromHist",1478,G__SplineFitDict_427_0_59, 121, -1, -1, 0, 1, 1, 1, 0, "d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("GetDate",670,G__SplineFitDict_427_0_60, 67, -1, -1, 0, 0, 1, 1, 9, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetFamilyName",1283,G__SplineFitDict_427_0_61, 67, -1, G__defined_typename("Text_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetHistGen",978,G__SplineFitDict_427_0_62, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TH1D), -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetHistShow",1113,G__SplineFitDict_427_0_63, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TH1D), -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetKindOfFit",1150,G__SplineFitDict_427_0_64, 105, G__get_linked_tagnum(&G__SplineFitDictLN_KindOfFit), -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetLowBound",1098,G__SplineFitDict_427_0_65, 103, -1, G__defined_typename("Bool_t"), 0, 1, 1, 1, 8, "d - 'Double_t' 1 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetMacro",786,G__SplineFitDict_427_0_66, 67, -1, -1, 0, 0, 1, 1, 9, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetMeasErr",975,G__SplineFitDict_427_0_67, 100, -1, G__defined_typename("Double_t"), 0, 1, 1, 1, 8, "i - 'Int_t' 0 - i", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetMeasT",762,G__SplineFitDict_427_0_68, 100, -1, G__defined_typename("Double_t"), 0, 1, 1, 1, 8, "i - 'Int_t' 0 - i", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetMeasV",764,G__SplineFitDict_427_0_69, 100, -1, G__defined_typename("Double_t"), 0, 1, 1, 1, 8, "i - 'Int_t' 0 - i", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetMemoryReduced",1621,G__SplineFitDict_427_0_70, 103, -1, G__defined_typename("Bool_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetMultiGraph",1309,G__SplineFitDict_427_0_71, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TMultiGraph), -1, 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetNbOfMeas",1035,G__SplineFitDict_427_0_72, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetNbOfMeasLast",1439,G__SplineFitDict_427_0_73, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetNbOfMeasSpline",1654,G__SplineFitDict_427_0_74, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetNbOfSplines",1379,G__SplineFitDict_427_0_75, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetParameter",1217,G__SplineFitDict_427_0_76, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetParameterDef",1488,G__SplineFitDict_427_0_77, 67, -1, -1, 0, 0, 1, 1, 1, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetPosInFamily",1387,G__SplineFitDict_427_0_78, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetProvidedName",1502,G__SplineFitDict_427_0_79, 67, -1, -1, 0, 0, 1, 1, 9, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetRandom",897,G__SplineFitDict_427_0_80, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetRandom",897,G__SplineFitDict_427_0_81, 100, -1, G__defined_typename("Double_t"), 0, 3, 1, 1, 0,
"i - 'Int_t' 0 - - d - 'Double_t' 0 - - "
"g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetSlope",803,G__SplineFitDict_427_0_82, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetSource",913,G__SplineFitDict_427_0_83, 67, -1, -1, 0, 0, 1, 1, 9, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetSpline",907,G__SplineFitDict_427_0_84, 103, -1, G__defined_typename("Bool_t"), 0, 5, 1, 1, 8,
"i - 'Int_t' 0 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("GetSpline",907,G__SplineFitDict_427_0_85, 103, -1, G__defined_typename("Bool_t"), 0, 5, 1, 1, 8,
"d - 'Double_t' 0 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("GetSplineNN",1063,G__SplineFitDict_427_0_86, 103, -1, G__defined_typename("Bool_t"), 0, 5, 1, 1, 8,
"i - 'Int_t' 0 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("GetSplineNN",1063,G__SplineFitDict_427_0_87, 103, -1, G__defined_typename("Bool_t"), 0, 5, 1, 1, 8,
"d - 'Double_t' 0 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("GetUpBound",989,G__SplineFitDict_427_0_88, 103, -1, G__defined_typename("Bool_t"), 0, 1, 1, 1, 8, "d - 'Double_t' 1 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetUseForRandom",1493,G__SplineFitDict_427_0_89, 103, -1, G__defined_typename("Bool_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetVLabel",854,G__SplineFitDict_427_0_90, 67, -1, -1, 0, 0, 1, 1, 9, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetXLabel",856,G__SplineFitDict_427_0_91, 67, -1, -1, 0, 0, 1, 1, 9, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetXLowInterval",1519,G__SplineFitDict_427_0_92, 100, -1, G__defined_typename("Double_t"), 0, 1, 1, 1, 8, "i - 'Int_t' 0 - i", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetXmax",702,G__SplineFitDict_427_0_93, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetXmin",700,G__SplineFitDict_427_0_94, 100, -1, G__defined_typename("Double_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetXUpInterval",1410,G__SplineFitDict_427_0_95, 100, -1, G__defined_typename("Double_t"), 0, 1, 1, 1, 8, "i - 'Int_t' 0 - i", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetYLabel",857,G__SplineFitDict_427_0_96, 67, -1, -1, 0, 0, 1, 1, 9, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("GetZLabel",858,G__SplineFitDict_427_0_97, 67, -1, -1, 0, 0, 1, 1, 9, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("InitRef",689,G__SplineFitDict_427_0_98, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::InitRef) ), 0);
G__memfunc_setup("InitStatic",1020,G__SplineFitDict_427_0_99, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::InitStatic) ), 0);
G__memfunc_setup("InitTwoPad",995,G__SplineFitDict_427_0_100, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::InitTwoPad) ), 0);
G__memfunc_setup("Integral",822,G__SplineFitDict_427_0_101, 100, -1, G__defined_typename("Double_t"), 0, 2, 1, 1, 0,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("IsEqual",692,(G__InterfaceMethod) NULL,103, -1, G__defined_typename("Bool_t"), 0, 1, 1, 1, 8, "U 'TObject' - 10 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("IsInCollection",1407,G__SplineFitDict_427_0_103, 103, -1, G__defined_typename("Bool_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("IsInCollection",1407,G__SplineFitDict_427_0_104, 103, -1, G__defined_typename("Bool_t"), 0, 1, 3, 1, 0, "U 'TSplineFit' - 0 - -", (char*)NULL, (void*) G__func2void( (Bool_t (*)(TSplineFit*))(&TSplineFit::IsInCollection) ), 0);
G__memfunc_setup("IsSortable",1016,(G__InterfaceMethod) NULL,103, -1, G__defined_typename("Bool_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("LoadFamily",994,G__SplineFitDict_427_0_106, 105, -1, G__defined_typename("Int_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("LoadFamily",994,G__SplineFitDict_427_0_107, 105, -1, G__defined_typename("Int_t"), 0, 1, 3, 1, 0, "C - 'Text_t' 10 - -", (char*)NULL, (void*) G__func2void( (Int_t (*)(const Text_t*))(&TSplineFit::LoadFamily) ), 0);
G__memfunc_setup("MinMax",586,G__SplineFitDict_427_0_108, 121, -1, -1, 0, 6, 1, 1, 8,
"g - 'Bool_t' 1 - - d - 'Double_t' 1 - - "
"d - 'Double_t' 1 - - g - 'Bool_t' 1 - - "
"d - 'Double_t' 1 - - d - 'Double_t' 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("MultinomialAsWeight",1959,G__SplineFitDict_427_0_109, 121, -1, -1, 0, 1, 3, 1, 0, "U 'TH1' - 0 - -", (char*)NULL, (void*) G__func2void( (void (*)(TH1*))(&TSplineFit::MultinomialAsWeight) ), 0);
G__memfunc_setup("NameFile",769,G__SplineFitDict_427_0_110, 121, -1, -1, 0, 1, 3, 1, 0, "C - - 10 '\"SplineFitDB.rdb\"' -", (char*)NULL, (void*) G__func2void( (void (*)(const char*))(&TSplineFit::NameFile) ), 0);
G__memfunc_setup("NameProg",793,G__SplineFitDict_427_0_111, 121, -1, -1, 0, 1, 3, 1, 0, "C - - 10 - -", (char*)NULL, (void*) G__func2void( (void (*)(const char*))(&TSplineFit::NameProg) ), 0);
G__memfunc_setup("NameWeb",671,G__SplineFitDict_427_0_112, 121, -1, -1, 0, 1, 3, 1, 0, "C - - 10 - -", (char*)NULL, (void*) G__func2void( (void (*)(const char*))(&TSplineFit::NameWeb) ), 0);
G__memfunc_setup("OrderFile",892,G__SplineFitDict_427_0_113, 103, -1, G__defined_typename("Bool_t"), 0, 1, 3, 1, 0, "g - 'Bool_t' 0 'kTRUE' -", (char*)NULL, (void*) G__func2void( (Bool_t (*)(Bool_t))(&TSplineFit::OrderFile) ), 0);
G__memfunc_setup("Pedestal",818,G__SplineFitDict_427_0_114, 100, -1, G__defined_typename("Double_t"), 0, 2, 1, 1, 0,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Print",525,G__SplineFitDict_427_0_115, 121, -1, -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("Purge",515,G__SplineFitDict_427_0_116, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::Purge) ), 0);
G__memfunc_setup("PurgeStatic",1131,G__SplineFitDict_427_0_117, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::PurgeStatic) ), 0);
G__memfunc_setup("RedoFit",685,G__SplineFitDict_427_0_118, 105, -1, G__defined_typename("Int_t"), 0, 1, 1, 1, 0, "g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("ReduceMemory",1233,G__SplineFitDict_427_0_119, 121, -1, -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("RemoveDisplay",1348,G__SplineFitDict_427_0_120, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::RemoveDisplay) ), 0);
G__memfunc_setup("RemoveFitFromFile",1701,G__SplineFitDict_427_0_121, 103, -1, G__defined_typename("Bool_t"), 0, 2, 3, 1, 0,
"C - 'Text_t' 0 - - g - 'Bool_t' 0 'kTRUE' -", (char*)NULL, (void*) G__func2void( (Bool_t (*)(Text_t*, Bool_t))(&TSplineFit::RemoveFitFromFile) ), 0);
G__memfunc_setup("SetDefaultLabels",1604,G__SplineFitDict_427_0_122, 121, -1, -1, 0, 0, 1, 1, 0, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("SetMacro",798,G__SplineFitDict_427_0_123, 121, -1, -1, 0, 1, 1, 1, 0, "C - 'Text_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SetMeasErr",987,G__SplineFitDict_427_0_124, 121, -1, -1, 0, 2, 1, 1, 0,
"i - 'Int_t' 0 - i d - 'Double_t' 0 - E", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SetMeasX",778,G__SplineFitDict_427_0_125, 121, -1, -1, 0, 2, 1, 1, 0,
"i - 'Int_t' 0 - i d - 'Double_t' 0 - x", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SetMeasY",779,G__SplineFitDict_427_0_126, 121, -1, -1, 0, 2, 1, 1, 0,
"i - 'Int_t' 0 - i d - 'Double_t' 0 - y", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SetParameter",1229,G__SplineFitDict_427_0_127, 121, -1, -1, 0, 2, 1, 1, 0,
"d - 'Double_t' 0 - - C - 'Text_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SetSource",925,G__SplineFitDict_427_0_128, 121, -1, -1, 0, 1, 1, 1, 0, "C - 'Text_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SetVLabel",866,G__SplineFitDict_427_0_129, 121, -1, -1, 0, 1, 1, 1, 0, "C - 'Text_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SetXLabel",868,G__SplineFitDict_427_0_130, 121, -1, -1, 0, 1, 1, 1, 0, "C - 'Text_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SetYLabel",869,G__SplineFitDict_427_0_131, 121, -1, -1, 0, 1, 1, 1, 0, "C - 'Text_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SetZLabel",870,G__SplineFitDict_427_0_132, 121, -1, -1, 0, 1, 1, 1, 0, "C - 'Text_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("ShowFitsInCollection",2042,G__SplineFitDict_427_0_133, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::ShowFitsInCollection) ), 0);
G__memfunc_setup("ShowFitsInFile",1390,G__SplineFitDict_427_0_134, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::ShowFitsInFile) ), 0);
G__memfunc_setup("ShowRandom",1026,G__SplineFitDict_427_0_135, 121, -1, -1, 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("SolveLeft",916,G__SplineFitDict_427_0_136, 103, -1, G__defined_typename("Bool_t"), 0, 5, 1, 1, 0,
"d - 'Double_t' 1 - - d - 'Double_t' 0 '0.0' - "
"g - 'Bool_t' 0 'kFALSE' - d - 'Double_t' 0 '-1.0' - "
"d - 'Double_t' 0 '1.0' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("SortCollection",1460,G__SplineFitDict_427_0_137, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::SortCollection) ), 0);
G__memfunc_setup("UpdateFile",995,G__SplineFitDict_427_0_138, 103, -1, G__defined_typename("Bool_t"), 0, 1, 1, 1, 0, "g - 'Bool_t' 0 'kFALSE' -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("UseForRandom",1205,G__SplineFitDict_427_0_139, 103, -1, G__defined_typename("Bool_t"), 0, 1, 1, 1, 0, "g - 'Bool_t' 0 'kTRUE' -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("V",86,G__SplineFitDict_427_0_140, 100, -1, G__defined_typename("Double_t"), 0, 1, 1, 1, 8, "d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("V",86,G__SplineFitDict_427_0_141, 100, -1, G__defined_typename("Double_t"), 0, 2, 1, 1, 8,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("V",86,G__SplineFitDict_427_0_142, 100, -1, G__defined_typename("Double_t"), 0, 3, 1, 1, 0,
"d - 'Double_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("V",86,G__SplineFitDict_427_0_143, 100, -1, G__defined_typename("Double_t"), 0, 3, 1, 1, 0,
"i - 'Int_t' 0 - - d - 'Double_t' 0 - - "
"d - 'Double_t' 0 - -", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("VerifyNotInFile",1501,G__SplineFitDict_427_0_144, 103, -1, G__defined_typename("Bool_t"), 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("WriteCollection",1559,G__SplineFitDict_427_0_145, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::WriteCollection) ), 0);
G__memfunc_setup("XNorm",500,G__SplineFitDict_427_0_146, 100, -1, G__defined_typename("Double_t"), 0, 1, 1, 1, 8, "d - 'Double_t' 0 - x", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("XpowerM",722,G__SplineFitDict_427_0_147, 100, -1, G__defined_typename("Double_t"), 0, 2, 3, 1, 0,
"d - 'Double_t' 0 - - i - 'Int_t' 0 - -", (char*)NULL, (void*) G__func2void( (Double_t (*)(Double_t, Int_t))(&TSplineFit::XpowerM) ), 0);
G__memfunc_setup("XUser",503,G__SplineFitDict_427_0_148, 100, -1, G__defined_typename("Double_t"), 0, 1, 1, 1, 8, "d - 'Double_t' 0 - x", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("Class",502,G__SplineFitDict_427_0_149, 85, G__get_linked_tagnum(&G__SplineFitDictLN_TClass), -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (TClass* (*)())(&TSplineFit::Class) ), 0);
G__memfunc_setup("Class_Name",982,G__SplineFitDict_427_0_150, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TSplineFit::Class_Name) ), 0);
G__memfunc_setup("Class_Version",1339,G__SplineFitDict_427_0_151, 115, -1, G__defined_typename("Version_t"), 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (Version_t (*)())(&TSplineFit::Class_Version) ), 0);
G__memfunc_setup("Dictionary",1046,G__SplineFitDict_427_0_152, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (void (*)())(&TSplineFit::Dictionary) ), 0);
G__memfunc_setup("IsA",253,(G__InterfaceMethod) NULL,85, G__get_linked_tagnum(&G__SplineFitDictLN_TClass), -1, 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("ShowMembers",1132,(G__InterfaceMethod) NULL,121, -1, -1, 0, 1, 1, 1, 0, "u 'TMemberInspector' - 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("Streamer",835,(G__InterfaceMethod) NULL,121, -1, -1, 0, 1, 1, 1, 0, "u 'TBuffer' - 1 - -", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("StreamerNVirtual",1656,G__SplineFitDict_427_0_156, 121, -1, -1, 0, 1, 1, 1, 0, "u 'TBuffer' - 1 - ClassDef_StreamerNVirtual_b", (char*)NULL, (void*) NULL, 0);
G__memfunc_setup("DeclFileName",1145,G__SplineFitDict_427_0_157, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TSplineFit::DeclFileName) ), 0);
G__memfunc_setup("ImplFileLine",1178,G__SplineFitDict_427_0_158, 105, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (int (*)())(&TSplineFit::ImplFileLine) ), 0);
G__memfunc_setup("ImplFileName",1171,G__SplineFitDict_427_0_159, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) G__func2void( (const char* (*)())(&TSplineFit::ImplFileName) ), 0);
G__memfunc_setup("DeclFileLine",1152,G__SplineFitDict_427_0_160, 105, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) G__func2void( (int (*)())(&TSplineFit::DeclFileLine) ), 0);
// automatic destructor
G__memfunc_setup("~TSplineFit", 1120, G__SplineFitDict_427_0_161, (int) ('y'), -1, -1, 0, 0, 1, 1, 0, "", (char*) NULL, (void*) NULL, 1);
// automatic assignment operator
G__memfunc_setup("operator=", 937, G__SplineFitDict_427_0_162, (int) ('u'), G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit), -1, 1, 1, 1, 1, 0, "u 'TSplineFit' - 11 - -", (char*) NULL, (void*) NULL, 0);
G__tag_memfunc_reset();
}
/*********************************************************
* Member function information setup
*********************************************************/
extern "C" void G__cpp_setup_memfuncSplineFitDict() {
}
/*********************************************************
* Global variable information setup for each class
*********************************************************/
static void G__cpp_setup_global0() {
/* Setting up global variables */
G__resetplocal();
}
static void G__cpp_setup_global1() {
}
static void G__cpp_setup_global2() {
}
static void G__cpp_setup_global3() {
}
static void G__cpp_setup_global4() {
}
static void G__cpp_setup_global5() {
}
static void G__cpp_setup_global6() {
}
static void G__cpp_setup_global7() {
G__memvar_setup((void*)G__PVOID,105,0,1,G__get_linked_tagnum(&G__SplineFitDictLN_KindOfFit),-1,-1,1,"NotDefined=0",0,(char*)NULL);
G__memvar_setup((void*)G__PVOID,105,0,1,G__get_linked_tagnum(&G__SplineFitDictLN_KindOfFit),-1,-1,1,"LinInterpol=1",0,(char*)NULL);
G__memvar_setup((void*)G__PVOID,105,0,1,G__get_linked_tagnum(&G__SplineFitDictLN_KindOfFit),-1,-1,1,"SplineInterpol=2",0,(char*)NULL);
G__memvar_setup((void*)G__PVOID,105,0,1,G__get_linked_tagnum(&G__SplineFitDictLN_KindOfFit),-1,-1,1,"SplineFit1D=3",0,(char*)NULL);
G__memvar_setup((void*)G__PVOID,105,0,1,G__get_linked_tagnum(&G__SplineFitDictLN_KindOfFit),-1,-1,1,"SplineFit2D=4",0,(char*)NULL);
G__memvar_setup((void*)G__PVOID,105,0,1,G__get_linked_tagnum(&G__SplineFitDictLN_KindOfFit),-1,-1,1,"SplineFit3D=5",0,(char*)NULL);
G__memvar_setup((void*)(&gSplineFit),85,0,0,G__get_linked_tagnum(&G__SplineFitDictLN_TSplineFit),-1,-1,1,"gSplineFit=",0,(char*)NULL);
G__resetglobalenv();
}
extern "C" void G__cpp_setup_globalSplineFitDict() {
G__cpp_setup_global0();
G__cpp_setup_global1();
G__cpp_setup_global2();
G__cpp_setup_global3();
G__cpp_setup_global4();
G__cpp_setup_global5();
G__cpp_setup_global6();
G__cpp_setup_global7();
}
/*********************************************************
* Global function information setup for each class
*********************************************************/
static void G__cpp_setup_func0() {
G__lastifuncposition();
}
static void G__cpp_setup_func1() {
}
static void G__cpp_setup_func2() {
}
static void G__cpp_setup_func3() {
}
static void G__cpp_setup_func4() {
}
static void G__cpp_setup_func5() {
G__resetifuncposition();
}
extern "C" void G__cpp_setup_funcSplineFitDict() {
G__cpp_setup_func0();
G__cpp_setup_func1();
G__cpp_setup_func2();
G__cpp_setup_func3();
G__cpp_setup_func4();
G__cpp_setup_func5();
}
/*********************************************************
* Class,struct,union,enum tag information setup
*********************************************************/
/* Setup class/struct taginfo */
G__linked_taginfo G__SplineFitDictLN_TClass = { "TClass" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TBuffer = { "TBuffer" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMemberInspector = { "TMemberInspector" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TObject = { "TObject" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TNamed = { "TNamed" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TString = { "TString" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_vectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgR = { "vector<ROOT::TSchemaHelper,allocator<ROOT::TSchemaHelper> >" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_reverse_iteratorlEvectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgRcLcLiteratorgR = { "reverse_iterator<vector<ROOT::TSchemaHelper,allocator<ROOT::TSchemaHelper> >::iterator>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TObjArray = { "TObjArray" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_vectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgR = { "vector<TVirtualArray*,allocator<TVirtualArray*> >" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_reverse_iteratorlEvectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgRcLcLiteratorgR = { "reverse_iterator<vector<TVirtualArray*,allocator<TVirtualArray*> >::iterator>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TPoly3 = { "TPoly3" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTBaselEfloatgR = { "TMatrixTBase<float>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTBaselEdoublegR = { "TMatrixTBase<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TVectorTlEfloatgR = { "TVectorT<float>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TVectorTlEdoublegR = { "TVectorT<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TElementActionTlEdoublegR = { "TElementActionT<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TElementPosActionTlEdoublegR = { "TElementPosActionT<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTRow_constlEdoublegR = { "TMatrixTRow_const<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTlEdoublegR = { "TMatrixT<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTSymlEdoublegR = { "TMatrixTSym<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTRowlEdoublegR = { "TMatrixTRow<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTSparselEdoublegR = { "TMatrixTSparse<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTSparseRow_constlEdoublegR = { "TMatrixTSparseRow_const<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTSparseRowlEdoublegR = { "TMatrixTSparseRow<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTDiag_constlEdoublegR = { "TMatrixTDiag_const<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTColumn_constlEdoublegR = { "TMatrixTColumn_const<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTSparseDiag_constlEdoublegR = { "TMatrixTSparseDiag_const<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTFlat_constlEdoublegR = { "TMatrixTFlat_const<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTSub_constlEdoublegR = { "TMatrixTSub_const<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTColumnlEdoublegR = { "TMatrixTColumn<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTDiaglEdoublegR = { "TMatrixTDiag<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTFlatlEdoublegR = { "TMatrixTFlat<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTSublEdoublegR = { "TMatrixTSub<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMatrixTSparseDiaglEdoublegR = { "TMatrixTSparseDiag<double>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TBandedLE = { "TBandedLE" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TArrayI = { "TArrayI" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TArrayD = { "TArrayD" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TZigZag = { "TZigZag" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TH1 = { "TH1" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TF1 = { "TF1" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TGraph = { "TGraph" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TGraphErrors = { "TGraphErrors" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_iteratorlEbidirectional_iterator_tagcOTObjectmUcOlongcOconstsPTObjectmUmUcOconstsPTObjectmUaNgR = { "iterator<bidirectional_iterator_tag,TObject*,long,const TObject**,const TObject*&>" , 115 , -1 };
G__linked_taginfo G__SplineFitDictLN_TMultiGraph = { "TMultiGraph" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_pairlEunsignedsPintcOintgR = { "pair<unsigned int,int>" , 115 , -1 };
G__linked_taginfo G__SplineFitDictLN_vectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgR = { "vector<pair<unsigned int,int>,allocator<pair<unsigned int,int> > >" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_reverse_iteratorlEvectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgRcLcLiteratorgR = { "reverse_iterator<vector<pair<unsigned int,int>,allocator<pair<unsigned int,int> > >::iterator>" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TFile = { "TFile" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TTree = { "TTree" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TBranch = { "TBranch" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_maplEstringcOTObjArraymUcOlesslEstringgRcOallocatorlEpairlEconstsPstringcOTObjArraymUgRsPgRsPgR = { "map<string,TObjArray*,less<string>,allocator<pair<const string,TObjArray*> > >" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TH1D = { "TH1D" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TH2D = { "TH2D" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TH3D = { "TH3D" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TSpline3 = { "TSpline3" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_TReference = { "TReference" , 99 , -1 };
G__linked_taginfo G__SplineFitDictLN_KindOfFit = { "KindOfFit" , 101 , -1 };
G__linked_taginfo G__SplineFitDictLN_TSplineFit = { "TSplineFit" , 99 , -1 };
/* Reset class/struct taginfo */
extern "C" void G__cpp_reset_tagtableSplineFitDict() {
G__SplineFitDictLN_TClass.tagnum = -1 ;
G__SplineFitDictLN_TBuffer.tagnum = -1 ;
G__SplineFitDictLN_TMemberInspector.tagnum = -1 ;
G__SplineFitDictLN_TObject.tagnum = -1 ;
G__SplineFitDictLN_TNamed.tagnum = -1 ;
G__SplineFitDictLN_TString.tagnum = -1 ;
G__SplineFitDictLN_vectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgR.tagnum = -1 ;
G__SplineFitDictLN_reverse_iteratorlEvectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgRcLcLiteratorgR.tagnum = -1 ;
G__SplineFitDictLN_TObjArray.tagnum = -1 ;
G__SplineFitDictLN_vectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgR.tagnum = -1 ;
G__SplineFitDictLN_reverse_iteratorlEvectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgRcLcLiteratorgR.tagnum = -1 ;
G__SplineFitDictLN_TPoly3.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTBaselEfloatgR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTBaselEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TVectorTlEfloatgR.tagnum = -1 ;
G__SplineFitDictLN_TVectorTlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TElementActionTlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TElementPosActionTlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTRow_constlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTSymlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTRowlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTSparselEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTSparseRow_constlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTSparseRowlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTDiag_constlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTColumn_constlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTSparseDiag_constlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTFlat_constlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTSub_constlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTColumnlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTDiaglEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTFlatlEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTSublEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TMatrixTSparseDiaglEdoublegR.tagnum = -1 ;
G__SplineFitDictLN_TBandedLE.tagnum = -1 ;
G__SplineFitDictLN_TArrayI.tagnum = -1 ;
G__SplineFitDictLN_TArrayD.tagnum = -1 ;
G__SplineFitDictLN_TZigZag.tagnum = -1 ;
G__SplineFitDictLN_TH1.tagnum = -1 ;
G__SplineFitDictLN_TF1.tagnum = -1 ;
G__SplineFitDictLN_TGraph.tagnum = -1 ;
G__SplineFitDictLN_TGraphErrors.tagnum = -1 ;
G__SplineFitDictLN_iteratorlEbidirectional_iterator_tagcOTObjectmUcOlongcOconstsPTObjectmUmUcOconstsPTObjectmUaNgR.tagnum = -1 ;
G__SplineFitDictLN_TMultiGraph.tagnum = -1 ;
G__SplineFitDictLN_pairlEunsignedsPintcOintgR.tagnum = -1 ;
G__SplineFitDictLN_vectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgR.tagnum = -1 ;
G__SplineFitDictLN_reverse_iteratorlEvectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgRcLcLiteratorgR.tagnum = -1 ;
G__SplineFitDictLN_TFile.tagnum = -1 ;
G__SplineFitDictLN_TTree.tagnum = -1 ;
G__SplineFitDictLN_TBranch.tagnum = -1 ;
G__SplineFitDictLN_maplEstringcOTObjArraymUcOlesslEstringgRcOallocatorlEpairlEconstsPstringcOTObjArraymUgRsPgRsPgR.tagnum = -1 ;
G__SplineFitDictLN_TH1D.tagnum = -1 ;
G__SplineFitDictLN_TH2D.tagnum = -1 ;
G__SplineFitDictLN_TH3D.tagnum = -1 ;
G__SplineFitDictLN_TSpline3.tagnum = -1 ;
G__SplineFitDictLN_TReference.tagnum = -1 ;
G__SplineFitDictLN_KindOfFit.tagnum = -1 ;
G__SplineFitDictLN_TSplineFit.tagnum = -1 ;
}
extern "C" void G__cpp_setup_tagtableSplineFitDict() {
/* Setting up class,struct,union tag entry */
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TClass);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TBuffer);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMemberInspector);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TObject);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TNamed);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TString);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_vectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_reverse_iteratorlEvectorlEROOTcLcLTSchemaHelpercOallocatorlEROOTcLcLTSchemaHelpergRsPgRcLcLiteratorgR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TObjArray);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_vectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_reverse_iteratorlEvectorlETVirtualArraymUcOallocatorlETVirtualArraymUgRsPgRcLcLiteratorgR);
G__tagtable_setup(G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TPoly3),sizeof(TPoly3),-1,324864,"Handling of 3rd order polynoms",G__setup_memvarTPoly3,G__setup_memfuncTPoly3);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTBaselEfloatgR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTBaselEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TVectorTlEfloatgR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TVectorTlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TElementActionTlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TElementPosActionTlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTRow_constlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTSymlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTRowlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTSparselEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTSparseRow_constlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTSparseRowlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTDiag_constlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTColumn_constlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTSparseDiag_constlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTFlat_constlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTSub_constlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTColumnlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTDiaglEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTFlatlEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTSublEdoublegR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMatrixTSparseDiaglEdoublegR);
G__tagtable_setup(G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TBandedLE),sizeof(TBandedLE),-1,324864,"CERN program F406 DBEQN translated to C++",G__setup_memvarTBandedLE,G__setup_memfuncTBandedLE);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TArrayI);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TArrayD);
G__tagtable_setup(G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TZigZag),sizeof(TZigZag),-1,325376,"Labelling of points such that point i+1 always near from point i",G__setup_memvarTZigZag,G__setup_memfuncTZigZag);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TH1);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TF1);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TGraph);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TGraphErrors);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_iteratorlEbidirectional_iterator_tagcOTObjectmUcOlongcOconstsPTObjectmUmUcOconstsPTObjectmUaNgR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TMultiGraph);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_pairlEunsignedsPintcOintgR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_vectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_reverse_iteratorlEvectorlEpairlEunsignedsPintcOintgRcOallocatorlEpairlEunsignedsPintcOintgRsPgRsPgRcLcLiteratorgR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TFile);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TTree);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TBranch);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_maplEstringcOTObjArraymUcOlesslEstringgRcOallocatorlEpairlEconstsPstringcOTObjArraymUgRsPgRsPgR);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TH1D);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TH2D);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TH3D);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TSpline3);
G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TReference);
G__tagtable_setup(G__get_linked_tagnum_fwd(&G__SplineFitDictLN_KindOfFit),sizeof(int),-1,0,(char*)NULL,NULL,NULL);
G__tagtable_setup(G__get_linked_tagnum_fwd(&G__SplineFitDictLN_TSplineFit),sizeof(TSplineFit),-1,325376,"General Handling of Spline fits",G__setup_memvarTSplineFit,G__setup_memfuncTSplineFit);
}
extern "C" void G__cpp_setupSplineFitDict(void) {
G__check_setup_version(30051515,"G__cpp_setupSplineFitDict()");
G__set_cpp_environmentSplineFitDict();
G__cpp_setup_tagtableSplineFitDict();
G__cpp_setup_inheritanceSplineFitDict();
G__cpp_setup_typetableSplineFitDict();
G__cpp_setup_memvarSplineFitDict();
G__cpp_setup_memfuncSplineFitDict();
G__cpp_setup_globalSplineFitDict();
G__cpp_setup_funcSplineFitDict();
if(0==G__getsizep2memfunc()) G__get_sizep2memfuncSplineFitDict();
return;
}
class G__cpp_setup_initSplineFitDict {
public:
G__cpp_setup_initSplineFitDict() { G__add_setup_func("SplineFitDict",(G__incsetup)(&G__cpp_setupSplineFitDict)); G__call_setup_funcs(); }
~G__cpp_setup_initSplineFitDict() { G__remove_setup_func("SplineFitDict"); }
};
G__cpp_setup_initSplineFitDict G__cpp_setup_initializerSplineFitDict;
|
a76efce98ef4d5ea1b5faa100498c8e489c1aa62 | 944d03ae650c73d8ea22cebc09e9d026c7794e6c | /lab1/Main.cpp | 7c6bb5fb5b7c5191f8a287e4b5f861e801d8229a | [
"MIT"
] | permissive | aimankazi10/cpp | 34447382e3dd3eabfeb1a39700df6c2f640ff476 | 20be363a840a5a56e7b229edfdde83fd1a858a30 | refs/heads/master | 2020-03-22T18:02:57.918260 | 2018-10-23T12:54:33 | 2018-10-23T12:54:33 | 140,433,340 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 457 | cpp | Main.cpp | /*
* Filename: Account.h
* Project: lab1
* Created Date: Friday, August 17th 2018, 4:35:20 pm
* Author: Aiman Kazi
*
* Copyright (c) 2018 Visual Labs Learning Solutions
*/
#include <iostream>
#include "Account.h"
using namespace std;
int main()
{
// Creating an Object / Instance of class Account
Account aiman;
// Classname.FunctionName -- called function
aiman.setInfo(1, "Aiman Kazi");
aiman.print();
} |
bf22e5d6eeb76f632a1bfab682361b80594c4f6a | 5af78e871cc4d5400b1364e79d52fbec851b7390 | /w011/KnightTour.cpp | 587133e45b7404afe4003a56f58dbf19fb70fe0a | [] | no_license | SpeedZhang/1071-C-Progrmming | 6a69f7a686fcf87b268ae09197bb01e83c516150 | 3aa85806cf689feba2f4576eb383f3ef7cb6ea1c | refs/heads/master | 2020-03-28T20:42:03.976818 | 2018-12-20T13:46:50 | 2018-12-20T13:46:50 | 149,094,521 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,188 | cpp | KnightTour.cpp | #include<stdio.h>
#include<time.h>
#include<stdlib.h>
struct Pos
{
int row;
int col;
};
void prArr(int m[][8])
{
for(int i=0;i<8;i++)
{
for(int j=0;j<8;j++)
{
printf("%3d",m[i][j]);
}
printf("\n");
}
}
Pos findNextPos(int m[][8],int row,int col)
{
int h[8]={2,1,-1,-2,-2,-1,1,2};
int v[8]={-1,-2,-2,-1,1,2,2,1};
Pos pos;
int nextRow,nextCol;
for(int i=0;i<8;i++)
{
nextRow=row+v[i];
nextCol=col+h[i];
if(nextRow>=0 && nextRow<=7 && nextCol>=0 && nextCol<=7 && m[nextRow][nextCol]==0)
{
pos.row=nextRow;
pos.col=nextCol;
return pos;
}
}
pos.row=-1;
pos.col=-1;
return pos;
}
int main()
{
int m[8][8]={0};
Pos pos;
srand(time(NULL));
int row = rand()%8;
int col = rand()%8;
m[row][col]=1;
for(int i=2;i<=64;i++)
{
pos=findNextPos(m,row,col);
m[pos.row][pos.col]=i;
row=pos.row;
col=pos.col;
if(pos.row==-1 && pos.col==-1)
{
prArr(m);
printf("\nTotal moves: %d\n",i-1);
break;
}
}
}
|
067fa878d84eaa9cb811f3aeddbe476f338eeb98 | d93e5c6023a6b7fdb93e130af3558859c944d96a | /apps/myApps/Doshi_u1212719/BehaviorAlgorithms/DecisionTree/Actions/DTLearnedActions.h | a3df7886873405802e1ed0958ee8da38119be4b6 | [
"MIT"
] | permissive | wanted28496/AIForGames | 14aa35b999ee36cf1f2188577ac83df61fbc079c | 8b958452ccf268ecd54990135a7a3dd154cab6d4 | refs/heads/master | 2020-12-28T07:09:28.892663 | 2020-06-15T21:22:45 | 2020-06-15T21:22:45 | 238,222,907 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,311 | h | DTLearnedActions.h | #pragma once
#include "DTActionBase.h"
#include "Boid.h"
#include "DynamicPathFollow.h"
#include "DynamicAlign.h"
#include "Structures.h"
#include "DTNode.h"
class DTActionTarget : public DTActionBase
{
bool mCompleted = false;
public:
DTActionTarget() {
mExpiryTime = 1;
}
~DTActionTarget() {
}
function<void()> GetTarget;
virtual bool CanInterrupt() override {
return true;
}
virtual bool IsActionCompleted() override {
if (mCompleted)
{
mCompleted = false;
return true;
}
return false;
}
virtual void Execute(float dt) override {
mCompleted = true;
GetTarget();
}
};
class DTMoveToTarget : public DTActionBase
{
bool mCompleted = false;
public:
DTMoveToTarget() {
mExpiryTime = 1;
}
~DTMoveToTarget() {
}
function<void()> GetTarget;
virtual bool CanInterrupt() override {
return true;
}
virtual bool IsActionCompleted() override {
return mCharacter->mTargets.empty();
}
virtual void Execute(float dt) override {
auto posSteering = DynamicPathFollow::GetSteering(mCharacter->mKinematic, mCharacter->mTargets);
auto rotSteering = DynamicLookWhereYouAreGoing::GetSteering(mCharacter->mKinematic);
mCharacter->mKinematic.UpdateDynamicMotion(posSteering + rotSteering, dt);
((AIBoid*)mCharacter)->mEnergy -= 0.166666667f * 0.9f;
}
}; |
4b604b68b1dc39f9e529c916a1dad55444eb7f48 | 237acec099992ddb5fc8d55f59d7a89b25724350 | /src/main.cpp | 243afa8c871d80672e1f42222cde1a575f074481 | [] | no_license | polyeezy/mouillette_indie | dbefe96b6ebf96143e152c95dced7093e75f5d42 | 268084ec43a6f1006399915c3141a6193ba96359 | refs/heads/master | 2021-01-11T06:09:28.384481 | 2016-06-06T21:32:20 | 2016-06-06T21:32:20 | 57,026,638 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 437 | cpp | main.cpp | //
// main.cpp for in /home/polyeezy/rendu/CPP/mouillette_indie/src
//
// Made by Valerian Polizzi
// Login <polyeezy@epitech.net>
//
// Started on Mon Apr 25 11:03:51 2016 Valerian Polizzi
// Last update Mon Jun 6 21:43:19 2016 Marc MORANT
//
# include <Core.hh>
# include <StudioException.hpp>
# include <GraphicManager.hh>
int main(int ac, char **av)
{
Core HyperSprint;
HyperSprint.mainLoop();
return (0);
}
|
bb928f64672122ba6dd16edbc9c16d5b7a5cef95 | 9e54c81646585dcb1fe9e20f5c76f2ce82ddabe3 | /src/GPUGenie/query.cc | 21c5bbd1ffdd65d6c0b7e72b034d41faf0659be3 | [] | no_license | zuacubd/GPUGENIE-Release | 00c706deac1729d8387c7f5974f7f61475239fbb | c4499605e19ba7c1408a243882ec21b9212c95a3 | refs/heads/ReleaseVersion | 2021-01-18T00:40:49.025694 | 2016-04-10T09:59:59 | 2016-04-10T09:59:59 | 59,502,626 | 1 | 0 | null | 2016-05-23T17:09:40 | 2016-05-23T17:09:40 | null | UTF-8 | C++ | false | false | 8,172 | cc | query.cc | /*! \file query.cc
* \brief Implementation for query class
*
*/
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <stdexcept>
#include <cmath>
#include "query.h"
#include "Logger.h"
typedef unsigned int u32;
typedef unsigned long long u64;
GPUGenie::query::query()
{
_ref_table = NULL;
_attr_map.clear();
_dim_map.clear();
_topk = 1;
_selectivity = -1.0f;
_index = -1;
_count = -1;
is_load_balanced = false;
use_load_balance = false;
}
GPUGenie::query::query(inv_table* ref, int index)
{
_ref_table = ref;
_attr_map.clear();
_dim_map.clear();
_topk = 1;
_selectivity = -1.0f;
_index = index;
_count = -1;
is_load_balanced = false;
use_load_balance = false;
}
GPUGenie::query::query(inv_table& ref, int index)
{
_ref_table = &ref;
_attr_map.clear();
_dim_map.clear();
_topk = 1;
_selectivity = -1.0f;
_index = index;
_count = 0;
is_load_balanced = false;
use_load_balance = false;
}
GPUGenie::inv_table*
GPUGenie::query::ref_table()
{
return _ref_table;
}
void GPUGenie::query::attr(int index, int low, int up, float weight)
{
attr(index, low, up, weight, -1);
}
void GPUGenie::query::attr(int index, int value, float weight,
float selectivity)
{
attr(index, value, value, weight, selectivity);
}
void GPUGenie::query::attr(int index, int low, int up, float weight,
float selectivity)
{
if (index < 0 || index >= _ref_table->m_size())
return;
range new_attr;
new_attr.low = low;
new_attr.up = up;
new_attr.weight = weight;
new_attr.dim = index;
new_attr.query = _index;
new_attr.low_offset = 0;
new_attr.up_offset = 0;
new_attr.selectivity = selectivity;
if (_attr_map.find(index) == _attr_map.end())
{
std::vector<range>* new_range_list = new std::vector<range>;
_attr_map[index] = new_range_list;
}
_attr_map[index]->push_back(new_attr);
_count++;
}
void GPUGenie::query::clear_dim(int index)
{
if (_attr_map.find(index) == _attr_map.end())
{
return;
}
_count -= _attr_map[index]->size();
_attr_map[index]->clear();
free(_attr_map[index]);
_attr_map.erase(index);
}
void GPUGenie::query::selectivity(float s)
{
_selectivity = s;
}
float GPUGenie::query::selectivity()
{
return _selectivity;
}
void GPUGenie::query::build_and_apply_load_balance(int max_load)
{
this->build();
if(max_load <= 0)
{
Logger::log(Logger::ALERT, "Please set a valid max_load.");
return;
}
_dims.clear();
map<int, vector<dim>*>::iterator di = _dim_map.begin();
for( ; di != _dim_map.end(); ++di)
{
std::vector<dim>& dims = *(di->second);
for(unsigned int i = 0; i < dims.size(); ++i)
{
unsigned int length = dims[i].end_pos - dims[i].start_pos;
if((unsigned int)max_load > length)
{
_dims.push_back(dims[i]);
continue;
}
unsigned int j = 1;
for(; max_load*j <= length; ++j)
{
dim new_dim;
new_dim.query = dims[i].query;
new_dim.weight = dims[i].weight;
new_dim.start_pos = max_load*(j-1) + dims[i].start_pos;
new_dim.end_pos = new_dim.start_pos + max_load;
_dims.push_back(new_dim);
}
if(max_load*(j-1) != length)
{
dim new_dim;
new_dim.query = dims[i].query;
new_dim.weight = dims[i].weight;
new_dim.start_pos = max_load*(j-1) + dims[i].start_pos;
new_dim.end_pos = dims[i].end_pos;
_dims.push_back(new_dim);
}
}
}
this->is_load_balanced = true;
}
void GPUGenie::query::apply_adaptive_query_range()
{
inv_table& table = *_ref_table;
if (table.build_status() == inv_table::not_builded)
{
Logger::log(Logger::ALERT,
"Please build the inverted table before applying adaptive query range.");
return;
}
u32 global_threshold =
_selectivity > 0 ? u32(ceil(_selectivity * table.i_size())) : -1;
u32 local_threshold;
for (std::map<int, std::vector<range>*>::iterator di = _attr_map.begin();
di != _attr_map.end(); ++di)
{
std::vector<range>* ranges = di->second;
int index = di->first;
for (unsigned int i = 0; i < ranges->size(); ++i)
{
range& d = ranges->at(i);
if (d.selectivity > 0)
{
local_threshold = ceil(d.selectivity * table.i_size());
}
else if (_selectivity > 0)
{
local_threshold = global_threshold;
}
else
{
Logger::log(Logger::ALERT, "Please set valid selectivity!");
return;
}
unsigned int count = 0;
for (int vi = d.low; vi <= d.up; ++vi)
{
if(!table.list_contain(index, vi))
continue;
count += table.get_posting_list_size(index, vi);
}
while (count < local_threshold)
{
if (d.low > 0)
{
d.low--;
if(!table.list_contain(index, d.low))
continue;
count += table.get_posting_list_size(index, d.low);
}
if(!table.list_contain(index, d.up+1))
{
if (d.low == 0)
break;
}
else
{
d.up++;
count += table.get_posting_list_size(index, d.up);
}
}
}
}
}
void GPUGenie::query::topk(int k)
{
_topk = k;
}
int GPUGenie::query::topk()
{
return _topk;
}
void GPUGenie::query::build()
{
int low, up;
float weight;
inv_table& table = *_ref_table;
vector<int>& inv_index = *table.inv_index();
vector<int>& inv_pos = *table.inv_pos();
for (std::map<int, std::vector<range>*>::iterator di = _attr_map.begin();
di != _attr_map.end(); ++di)
{
int index = di->first;
std::vector<range>& ranges = *(di->second);
int d = index << _ref_table->shifter();
if (ranges.empty())
{
continue;
}
if (_dim_map.find(index) == _dim_map.end())
{
std::vector<dim>* new_list = new std::vector<dim>;
_dim_map[index] = new_list;
}
for (unsigned int i = 0; i < ranges.size(); ++i)
{
range& ran = ranges[i];
low = ran.low;
up = ran.up;
weight = ran.weight;
if(low > up || low > table.get_upperbound_of_list(index) || up < table.get_lowerbound_of_list(index))
{
continue;
}
dim new_dim;
new_dim.weight = weight;
new_dim.query = _index;
low = low < table.get_lowerbound_of_list(index)?table.get_lowerbound_of_list(index):low;
up = up > table.get_upperbound_of_list(index)?table.get_upperbound_of_list(index):up;
int _min, _max;
_min = d + low - table.get_lowerbound_of_list(index);
_max = d + up - table.get_lowerbound_of_list(index);
new_dim.start_pos = inv_pos[inv_index[_min]];
new_dim.end_pos = inv_pos[inv_index[_max+1]];
_dim_map[index]->push_back(new_dim);
}
}
}
int GPUGenie::query::dump(vector<dim>& vout)
{
if (is_load_balanced)
{
for(unsigned int i = 0; i < _dims.size(); ++i)
{
vout.push_back(_dims[i]);
}
return _dims.size();
}
int count = 0;
for (std::map<int, std::vector<dim>*>::iterator di = _dim_map.begin();
di != _dim_map.end(); ++di)
{
std::vector<dim>& ranges = *(di->second);
count += ranges.size();
for (unsigned int i = 0; i < ranges.size(); ++i)
{
vout.push_back(ranges[i]);
}
}
return count;
}
int GPUGenie::query::index()
{
return _index;
}
int GPUGenie::query::count_ranges()
{
return _count;
}
void GPUGenie::query::print(int limit)
{
Logger::log(Logger::DEBUG, "This query has %d dimensions.",
_attr_map.size());
int count = limit;
for (std::map<int, std::vector<range>*>::iterator di = _attr_map.begin();
di != _attr_map.end(); ++di)
{
std::vector<range>& ranges = *(di->second);
for (unsigned int i = 0; i < ranges.size(); ++i)
{
if (count == 0)
return;
if (count > 0)
count--;
range& d = ranges[i];
Logger::log(Logger::DEBUG,
"dim %d from query %d: low %d(offset %d), up %d(offset %d), weight %.2f, selectivity %.2f.",
d.dim, d.query, d.low, d.low_offset, d.up, d.up_offset,
d.weight, d.selectivity);
}
}
}
|
c9ea1a12a15b23bca1c2a6f0f35a2de0246001ef | 7982ef7401018a7927250634104995af0463cd90 | /tests/test_mapPoint.cpp | e33df1449c3450f1017a291cc3186031730fde89 | [] | no_license | Megacephalo/ekf_slam_in_cxx | 33dbb320e36139c2eef166d902aa5f5f4fa13e5b | 819998bf5ccf3c864e42d7b26697a12f27313ada | refs/heads/master | 2022-10-28T14:11:03.797257 | 2020-06-08T19:14:10 | 2020-06-08T19:14:10 | 266,941,281 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 450 | cpp | test_mapPoint.cpp | #include <gtest/gtest.h>
#include <iostream>
#include <memory>
#include <string>
#include "map_point.h"
TEST(MapPoint_test, print_overloading) {
MapPoint mapPt ;
// test initial values
std::cout << mapPt << std::endl ;
// Specify values
mapPt.id = 123 ;
mapPt.x = 3.14159 ;
mapPt.y = 1.1429 ;
std::cout << mapPt << std::endl ;
}
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv) ;
return RUN_ALL_TESTS() ;
} |
9add58033abb48965d47a609a33ec50e0a87575e | 52f72a3b208452e22009526110b33a46eb46b70e | /Engine/Source/RenderCore/Public/Platform/IGPUBuffer.h | 1e34e38710d10d4aefeab60fea67ab8916d7d6e8 | [] | no_license | lineCode/Berserk | b5bb1e66b2062e78ff51643c2c81dc269800a099 | 5b856a46693f4584c08d2ed335d0c5fba3466601 | refs/heads/master | 2020-05-09T16:18:59.103498 | 2019-04-13T21:59:47 | 2019-04-13T21:59:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,890 | h | IGPUBuffer.h | //
// Created by Egor Orachyov on 07.02.2019.
//
#ifndef BERSERK_IGPUBUFFER_H
#define BERSERK_IGPUBUFFER_H
#include "Misc/Bits.h"
#include "Misc/Types.h"
#include "Misc/UsageDescriptors.h"
#include "Resource/IResource.h"
#include "Platform/IRenderDriver.h"
namespace Berserk
{
namespace Resources
{
/**
* Abstract gpu buffer for storing mesh/model data
*/
class GRAPHICS_API IGPUBuffer : public IResource
{
public:
/**
* Vertex types for mesh/model data
*/
enum VertexType : uint32
{
eVT_Position = SHIFT(0),
eVT_Normal = SHIFT(1),
eVT_Tangent = SHIFT(2),
eVT_Bitangent = SHIFT(3),
eVT_TexCoords = SHIFT(4),
eVT_Vertex = eVT_Position,
eVT_VertexPN = eVT_Position | eVT_Normal,
eVT_VertexPT = eVT_Position | eVT_TexCoords,
eVT_VertexPNT = eVT_VertexPN | eVT_TexCoords,
eVT_VertexPNTBT = eVT_VertexPNT | eVT_Tangent | eVT_Bitangent
};
public:
/**
* Creates gpu vertex array object with chosen params and
* data of the mesh/model object
* @param verticesCount Count of vertices in the array
* @param vertexType Type of vertices in the array
* @param vertices Pointer to data
* @param indicesCount Count of indices
* @param indices Pointer to indices
*/
virtual void create(uint32 verticesCount,
VertexType vertexType,
void* vertices,
uint32 indicesCount,
uint16* indices) = 0;
/**
* Draw with params of that buffer
* @param count Count of indices to be rendered
* @param primitiveType Type of primitives, defined by indices
* @param indicesType Type of indices in the array
*/
virtual void draw(uint32 count,
IRenderDriver::PrimitiveType primitiveType,
IRenderDriver::DataType indicesType) = 0;
/** Send that buffer data to the gpu to render it */
virtual void draw() = 0;
/** @return Type of vertices in the buffer */
virtual VertexType getVertexType() = 0;
/** @return Count of vertices in the buffer */
virtual uint32 getVertexCount() = 0;
/** @return Memory used at gpu side */
virtual uint32 getGPUMemoryUsage() = 0;
};
} // namespace Resources
} // namespace Berserk
#endif //BERSERK_IGPUBUFFER_H |
834f6acc895aa97539dd2d8524e20eaccd47b695 | 3ac7658c1554f63865eb92a92a9a9b29f462b797 | /EXP/2018-2019(2) EXP/实验1 王程飞 201806061219/ex2 clock/Clock.hpp | 00478594216bde0ee849650550ca4c5296fc2797 | [] | no_license | yuhuarong/MyCPPExperiment | 9d8f050c616d97f9725fd5809867aedbaddcf637 | 13cac9edb0a1857a456409ba92151c6a90183ac3 | refs/heads/master | 2020-09-22T16:25:04.214263 | 2019-11-26T17:41:52 | 2019-11-26T17:41:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 184 | hpp | Clock.hpp | class Clock{
public:
double diff(const Clock &clock);
void init(int, int, int);
void init();
void toString();
private:
int h;
int m;
int s;
long normlize() const;
};
|
805df7c5f6f3a1b33382b8d74f1a7b34193380db | 93f328e10b5b02ac0cdb4afdf1a84db83bcadfa5 | /ia/13/rbtree.cpp | a3691912a5d6c1cfc9c5c892a28895e045827640 | [] | no_license | missingjs/mustard | 184eba4e9abe698716a3f540b7518c5da73055e9 | ad4cf820a6bdfa8535c07dbdfdaf57f0e3caed96 | refs/heads/master | 2022-02-27T12:34:32.393355 | 2016-08-21T16:00:21 | 2016-08-21T16:00:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 622 | cpp | rbtree.cpp | // @mission: Red Black Tree
#include <iostream>
#include "rbtree.def.h"
#include "common/array.h"
using namespace mustard;
int main()
{
int len = 0;
int * arr = array::read<int>(len);
RBTree tree;
for (int i = 0; i < len; ++i) {
tree.insert(arr[i]);
}
tree.display();
// int a = 0, b = len - 1, c = len/2;
//
// tree.remove(arr[a]);
// tree.remove(arr[b]);
// tree.remove(arr[c]);
//
// std::cout << "after remove " << arr[a] << ',' << arr[b] << ',' << arr[c] << '\n';
tree.remove(100);
tree.remove(70);
tree.display();
delete[] arr;
return 0;
}
|
00c0f2e96ea09619e536f7d4358bfe998108da57 | 30d1b99eca915b7a7b57fc1fbac1d9310ed27483 | /Lab 0/apriori_with_partitions.cpp | 29dbd10b04717ad90d1c1f383840da7a9254fecd | [] | no_license | SinghNehal/Data-Mining-DMW532C | c48328a85c9f6426cb928a141cd65e0e97946ca3 | 2a347b14a49d644b9b31b6fe20a0c727df3396ba | refs/heads/master | 2022-12-08T22:42:45.744641 | 2020-09-08T12:25:21 | 2020-09-08T12:25:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,933 | cpp | apriori_with_partitions.cpp | #include<bits/stdc++.h>
#include<map>
using namespace std;
ifstream fin;
double minsupport;
vector<set<string> >candidate_set;
vector<set<string> >candidate_set1;
vector<set<string> >candidate_set2;
set<string>itemset;
set<string>itemset1;
set<string>itemset2;
map<string,int>freq;
map<string,int>freq1;
map<string,int>freq2;
vector<string> wordsof(string str){
vector<string> tmpset;
string tmp="";
int i=0;
while(str[i]){
if(isalnum(str[i]))tmp+=str[i];
else{
if(tmp.size()>0)
tmpset.push_back(tmp);
tmp="";
}
i++;
}
if(tmp.size()>0)tmpset.push_back(tmp);
return tmpset;
}
string combine(vector<string> &arr,int miss){
string str;
for(int i=0;i<arr.size();i++)
if(i!=miss)str+=arr[i]+" ";
str=str.substr(0,str.size()-1);
return str;
}
set<string> cloneit(set<string>&arr){
set<string>dup;
for(set<string>::iterator it=arr.begin();it!=arr.end();it++)dup.insert(*it);
return dup;
}
set<string> apriori_gen(set<string>&sets,int k){
set<string>set2;
for(set<string>::iterator it1=sets.begin();it1!=sets.end();it1++){
set<string>::iterator it2=it1;
it2++;
for(;it2!=sets.end();it2++){
vector<string>v1=wordsof(*it1);
vector<string>v2=wordsof(*it2);
bool alleq=true;
for(int i=0;i<k-1&&alleq;i++)
if(v1[i]!=v2[i])
alleq=false;
if(!alleq)continue;
v1.push_back(v2[k-1]);
if(v1[v1.size()-1]<v1[v1.size()-2])
swap(v1[v1.size()-1],v1[v1.size()-2]);
for(int i=0;i<v1.size()&&alleq;i++){
string tmp=combine(v1,i);
if(sets.find(tmp)==sets.end())alleq=false;
}
if(alleq)set2.insert(combine(v1,-1));
}
}
return set2;
}
int main(){
fin.open("./Data/retail.dat");
cout<<"Minimum Support % :";
cin>>minsupport;
double minsupport1,minsupport2;
minsupport1 = minsupport;
minsupport2 = minsupport;
string str;
while(!fin.eof()){
getline(fin,str);
vector<string>arr=wordsof(str);
set<string>tmpset;
for(int i=0;i<arr.size();i++)tmpset.insert(arr[i]);
candidate_set.push_back(tmpset);
for(set<string>::iterator it=tmpset.begin();it!=tmpset.end();it++){
itemset.insert(*it);
freq[*it]++;
}
}
fin.close();
for(int l = 0;l<candidate_set.size()/2;l++){
candidate_set1.push_back(candidate_set[l]);
for(set<string>::iterator it=candidate_set[l].begin();it!=candidate_set[l].end();it++){
itemset1.insert(*it);
freq1[*it]++;
}
}
for(int l = candidate_set.size()/2;l<candidate_set.size();l++){
candidate_set2.push_back(candidate_set[l]);
for(set<string>::iterator it=candidate_set[l].begin();it!=candidate_set[l].end();it++){
itemset2.insert(*it);
freq2[*it]++;
}
}
cout<<"No of transactions complete: "<<candidate_set.size()<<endl;
minsupport=minsupport*candidate_set.size()/100;
cout<<"Minimum Support Count complete: "<<minsupport<<endl;
queue<set<string>::iterator>q;
for(set<string>::iterator it=itemset.begin();it!=itemset.end();it++)
if(freq[*it]<minsupport)q.push(it);
while(q.size()>0){
itemset.erase(*q.front());
q.pop();
}
for(set<string>::iterator it=itemset.begin();it!=itemset.end();it++)
cout<<*it<<" "<<freq[*it]<<endl;
int i=2;
set<string>prev=cloneit(itemset);
while(i){
set<string>cur=apriori_gen(prev,i-1);
if(cur.size()<1)break;
for(set<string>::iterator it=cur.begin();it!=cur.end();it++){
vector<string>arr=wordsof(*it);
int tot=0;
for(int j=0;j<candidate_set.size();j++){
bool pres=true;
for(int k=0;k<arr.size()&&pres;k++)
if(candidate_set[j].find(arr[k])==candidate_set[j].end())
pres=false;
if(pres)tot++;
}
if(tot>=minsupport)freq[*it]+=tot;
else q.push(it);
}
while(q.size()>0){
cur.erase(*q.front());
q.pop();
}
for(set<string>::iterator it=cur.begin();it!=cur.end();it++)
cout<<*it<<" "<<freq[*it]<<endl;
prev=cloneit(cur);
i++;
}
cout << endl;
// ------------------------------------------------------------
cout<< "Partition 1\n";
cout<<"No of transactions partition1 : "<<candidate_set1.size()<<endl;
minsupport1=minsupport1*candidate_set1.size()/100;
cout<<"Minimum Support Count partition1 :"<<minsupport1<<endl;
queue<set<string>::iterator>q1;
for(set<string>::iterator it=itemset1.begin();it!=itemset1.end();it++)
if(freq1[*it]<minsupport1)q1.push(it);
while(q1.size()>0){
itemset1.erase(*q1.front());
q1.pop();
}
for(set<string>::iterator it=itemset1.begin();it!=itemset1.end();it++)
cout<<*it<<" "<<freq1[*it]<<endl;
i=2;
set<string>prev1=cloneit(itemset1);
while(i){
set<string>cur=apriori_gen(prev1,i-1);
if(cur.size()<1)break;
for(set<string>::iterator it=cur.begin();it!=cur.end();it++){
vector<string>arr=wordsof(*it);
int tot=0;
for(int j=0;j<candidate_set1.size();j++){
bool pres=true;
for(int k=0;k<arr.size()&&pres;k++)
if(candidate_set1[j].find(arr[k])==candidate_set1[j].end())
pres=false;
if(pres)tot++;
}
if(tot>=minsupport1)freq1[*it]+=tot;
else q1.push(it);
}
while(q1.size()>0){
cur.erase(*q1.front());
q1.pop();
}
for(set<string>::iterator it=cur.begin();it!=cur.end();it++)
cout<<*it<<" "<<freq1[*it]<<endl;
prev1=cloneit(cur);
i++;
}
cout << endl;
// ------------------------------------------------------------
cout<< "Partition 2\n";
cout<<"No of transactions partition2: "<<candidate_set2.size()<<endl;
minsupport2=minsupport2*candidate_set2.size()/100;
cout<<"Minimum Support Count: "<<minsupport2<<endl;
queue<set<string>::iterator>q2;
for(set<string>::iterator it=itemset2.begin();it!=itemset2.end();it++)
if(freq2[*it]<minsupport2)q2.push(it);
while(q2.size()>0){
itemset2.erase(*q2.front());
q2.pop();
}
for(set<string>::iterator it=itemset2.begin();it!=itemset2.end();it++)
cout<<*it<<" "<<freq2[*it]<<endl;
i=2;
set<string>prev2=cloneit(itemset2);
while(i){
set<string>cur=apriori_gen(prev2,i-1);
if(cur.size()<1)break;
for(set<string>::iterator it=cur.begin();it!=cur.end();it++){
vector<string>arr=wordsof(*it);
int tot=0;
for(int j=0;j<candidate_set2.size();j++){
bool pres=true;
for(int k=0;k<arr.size()&&pres;k++)
if(candidate_set2[j].find(arr[k])==candidate_set2[j].end())
pres=false;
if(pres)tot++;
}
if(tot>=minsupport2)freq2[*it]+=tot;
else q2.push(it);
}
while(q2.size()>0){
cur.erase(*q2.front());
q2.pop();
}
for(set<string>::iterator it=cur.begin();it!=cur.end();it++)
cout<<*it<<" "<<freq2[*it]<<endl;
prev2=cloneit(cur);
i++;
}
} |
6ab78877a23cdddd3576742ef83ae1017e78e888 | 1fd33efcea837bb2ffcd32fcdceee78e246e1414 | /mediatek/hardware/ril/librilmtk/ril.cpp | 7b8af22a611d212029ac47c823521019e8f6b262 | [
"Apache-2.0"
] | permissive | rock12/android_kernel_xbasic | cda1c5a956cf8afdc6b9440cefd84644e4bfd7b5 | 38d09253ba7ef2e7e4ba2ee7f448a04457159ddb | refs/heads/master | 2021-01-17T08:38:46.441103 | 2016-07-01T19:36:39 | 2016-07-01T19:36:39 | 62,417,176 | 2 | 0 | null | 2016-07-01T20:07:19 | 2016-07-01T20:07:19 | null | UTF-8 | C++ | false | false | 205,948 | cpp | ril.cpp | /* Copyright Statement:
*
* This software/firmware and related documentation ("MediaTek Software") are
* protected under relevant copyright laws. The information contained herein
* is confidential and proprietary to MediaTek Inc. and/or its licensors.
* Without the prior written permission of MediaTek inc. and/or its licensors,
* any reproduction, modification, use or disclosure of MediaTek Software,
* and information contained herein, in whole or in part, shall be strictly prohibited.
*/
/* MediaTek Inc. (C) 2010. All rights reserved.
*
* BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
* THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
* CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
* SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
* STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
* CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* The following software/firmware and/or related documentation ("MediaTek Software")
* have been modified by MediaTek Inc. All revisions are subject to any receiver's
* applicable license agreements with MediaTek Inc.
*/
/* //device/libs/telephony/ril.cpp
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#ifdef MTK_RIL_MD1
#define LOG_TAG "RILC"
#else
#define LOG_TAG "RILCMD2"
#endif
#include <hardware_legacy/power.h>
#include <telephony/ril.h>
#include <telephony/ril_cdma_sms.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <errno.h>
#include <assert.h>
#include <ctype.h>
#include <alloca.h>
#include <assert.h>
#include <netinet/in.h>
#include <cutils/properties.h>
#include <librilmtk.h>
#include <DfoDefines.h>
/* MTK */
namespace android {
#include <ril_gsm_util.h>
static void listenCallback (int fd, short flags, void *param);
#ifdef FATAL_ERROR_HANDLE
static void handleRILDFatalError();
#endif
static RILId s_ril_cntx[] = {
MTK_RIL_SOCKET_1
#ifdef MTK_GEMINI
, MTK_RIL_SOCKET_2
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
, MTK_RIL_SOCKET_3
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
, MTK_RIL_SOCKET_4
#endif
#endif
};
#define PHONE_PROCESS "radio"
#define SOCKET_NAME_RIL "rild"
#ifdef MTK_GEMINI
#define PHONE2_PROCESS "radio2"
#define SOCKET_NAME_RIL2 "rild2"
#define PROPERTY_3G_SIM "gsm.3gswitch"
#if (MTK_GEMINI_SIM_NUM >= 3)
#define PHONE3_PROCESS "radio3"
#define SOCKET_NAME_RIL3 "rild3"
#endif
#if (MTK_GEMINI_SIM_NUM >= 4)
#define PHONE4_PROCESS "radio4"
#define SOCKET_NAME_RIL4 "rild4"
#endif
#endif /* MTK_GEMINI */
#define SOCKET_NAME_RIL_DEBUG "rild-debug"
#ifndef REVERSE_MTK_CHANGE
#define SOCKET_NAME_MTK_UT "rild-mtk-ut"
#define SOCKET_NAME_MTK_UT_2 "rild-mtk-ut-2"
#endif
#define SOCKET_NAME_RIL_MD2 "rild-md2"
#define SOCKET_NAME_RIL2_MD2 "rild2-md2"
#define SOCKET_NAME_RIL_DEBUG_MD2 "rild-debug-md2"
#define SOCKET_NAME_MTK_UT_MD2 "rild-mtk-ut-md2"
#define SOCKET_NAME_MTK_UT_2_MD2 "rild-mtk-ut-2-md2"
#define SOCKET_NAME_ATCI_MD2 "rild-atci-md2"
/* atci start */
#define SOCKET_NAME_ATCI "rild-atci"
/* atci end */
#define ANDROID_WAKE_LOCK_NAME "radio-interface"
#define PROPERTY_RIL_IMPL "gsm.version.ril-impl"
// match with constant in RIL.java
#define MAX_COMMAND_BYTES (8 * 1024)
// Basically: memset buffers that the client library
// shouldn't be using anymore in an attempt to find
// memory usage issues sooner.
#define MEMSET_FREED 1
#define NUM_ELEMS(a) (sizeof (a) / sizeof (a)[0])
#define MIN(a,b) ((a)<(b) ? (a) : (b))
/* Constants for response types */
#define RESPONSE_SOLICITED 0
#define RESPONSE_UNSOLICITED 1
/* Negative values for private RIL errno's */
#define RIL_ERRNO_INVALID_RESPONSE -1
// request, response, and unsolicited msg print macro
#define PRINTBUF_SIZE 8096
// Enable RILC log (don't enable when MTK_RIL is defined)
#define RILC_LOG 0
#define startRequest
#define closeRequest
#define printRequest(token, req)
#define startResponse
#define closeResponse
#define printResponse
#define clearPrintBuf
#define removeLastChar
#define appendPrintBuf(x...)
/*******************************************************************/
RIL_RadioFunctions s_callbacks = {0, NULL, NULL, NULL, NULL, NULL};
static int s_registerCalled = 0;
static pthread_t s_tid_dispatch;
static pthread_t s_tid_reader;
static int s_started = 0;
static int s_fdListen = -1;
static int s_fdCommand = -1;
#ifdef MTK_GEMINI
static int s_fdListen2 = -1;
static int s_fdCommand2 = -1;
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
static int s_fdListen3 = -1;
static int s_fdCommand3 = -1;
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
static int s_fdListen4 = -1;
static int s_fdCommand4 = -1;
#endif
#endif /* MTK_GEMINI */
static int s_fdDebug = -1;
static int s_mdCounter = 0;
static int s_fdDebug_command = -1;
#ifndef REVERSE_MTK_CHANGE
static int s_fdUT_listen = -1;
static int s_fdUT_command = -1;
static int s_fdUT_tmp_command = -1;
#ifdef MTK_GEMINI
static int s_fdUT_listen2 = -1;
static int s_fdUT_command2 = -1;
static int s_fdUT_tmp_command2 = -1;
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
static int s_fdUT_listen3 = -1;
static int s_fdUT_command3 = -1;
static int s_fdUT_tmp_command3 = -1;
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
static int s_fdUT_listen4 = -1;
static int s_fdUT_command4 = -1;
static int s_fdUT_tmp_command4 = -1;
#endif
#endif /*MTK_GEMINI*/
#endif /*REVERSE_MTK_CHANGE*/
/* atci start */
static int s_fdATCI_listen = -1;
static int s_fdATCI_command = -1;
static int s_fdReserved_command = -1;
/* atci end */
static int s_fdWakeupRead;
static int s_fdWakeupWrite;
static struct ril_event s_commands_event;
static struct ril_event s_wakeupfd_event;
static struct ril_event s_listen_event;
static struct ril_event s_wake_timeout_event;
static struct ril_event s_debug_event;
#ifdef MTK_GEMINI
static struct ril_event s_commands_event2;
static struct ril_event s_listen_event2;
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
static struct ril_event s_commands_event3;
static struct ril_event s_listen_event3;
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
static struct ril_event s_commands_event4;
static struct ril_event s_listen_event4;
#endif
#endif /* MTK_GEMINI */
#ifndef REVERSE_MTK_CHANGE
static struct ril_event s_UTlisten_event;
static struct ril_event s_UTcommand_event;
#ifdef MTK_GEMINI
static struct ril_event s_UTlisten_event2;
static struct ril_event s_UTcommand_event2;
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
static struct ril_event s_UTlisten_event3;
static struct ril_event s_UTcommand_event3;
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
static struct ril_event s_UTlisten_event4;
static struct ril_event s_UTcommand_event4;
#endif
#endif /*MTK_GEMINI*/
#endif /*REVERSE_MTK_CHANGE*/
/* atci start */
static struct ril_event s_ATCIlisten_event;
static struct ril_event s_ATCIcommand_event;
static char simNo[PROPERTY_VALUE_MAX];
/* atci end */
static const struct timeval TIMEVAL_WAKE_TIMEOUT = {1,0};
static pthread_mutex_t s_pendingRequestsMutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t s_writeMutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t s_startupMutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t s_startupCond = PTHREAD_COND_INITIALIZER;
static RequestInfo *s_pendingRequests = NULL;
#ifdef MTK_GEMINI
static pthread_mutex_t s_pendingRequestsMutex2 = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t s_writeMutex2 = PTHREAD_MUTEX_INITIALIZER;
static RequestInfo *s_pendingRequests2 = NULL;
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
static pthread_mutex_t s_pendingRequestsMutex3 = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t s_writeMutex3 = PTHREAD_MUTEX_INITIALIZER;
static RequestInfo *s_pendingRequests3 = NULL;
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
static pthread_mutex_t s_pendingRequestsMutex4 = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t s_writeMutex4 = PTHREAD_MUTEX_INITIALIZER;
static RequestInfo *s_pendingRequests4 = NULL;
#endif
#endif /* MTK_GEMINI */
#ifdef MTK_RIL
pthread_mutex_t s_dispatchMutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t s_dispatchCond = PTHREAD_COND_INITIALIZER;
pthread_mutex_t s_queryThreadMutex = PTHREAD_MUTEX_INITIALIZER;
RequestInfoProxy* s_Proxy[RIL_SUPPORT_PROXYS] = {NULL};
pthread_t s_tid_proxy[RIL_SUPPORT_PROXYS];
#endif /* MTK_RIL */
static UserCallbackInfo *s_last_wake_timeout_info = NULL;
static void *s_lastNITZTimeData = NULL;
static size_t s_lastNITZTimeDataSize;
SocketListenParam s_SocketLinterParam1;
#ifdef MTK_GEMINI
SocketListenParam s_SocketLinterParam2;
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
SocketListenParam s_SocketLinterParam3;
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
SocketListenParam s_SocketLinterParam4;
#endif
#endif /* MTK_GEMINI */
// to store STK PCI string temporarily
//static char *s_tempStkPci = NULL;
//static char *s_tempStkPci_2 = NULL;
//static int s_tempStkPciFlag = 0;
//static int s_tempStkPciFlag_2 = 0;
static char *s_tempStkPci[MTK_RIL_SOCKET_NUM] = {NULL};
static int s_tempStkPciFlag[MTK_RIL_SOCKET_NUM] = {0};
static AtResponseList* cacheUrc(AtResponseList* pendedUrcList,
int unsolResponse,
void *data,
size_t datalen,
RILId id);
static void sendPendedUrcs(RILId rid);
static void onTempStkPci(RILId rid);
// To queue PHB ready event
static int s_phbReadyFlag[MTK_RIL_SOCKET_NUM] = {0};
/* Store ECFU URC and send to RILJ after socket is connected. */
#ifndef REVERSE_MTK_CHANGE
#ifndef MTK_RILD_UT
#define ECFU_COUNT 10
static void storeEcfuUrc(int unsolResponse, RILId id, void *data);
static void onEcfu(RILId rid);
static int s_tempEcfu_1[ECFU_COUNT][2];
static int s_tempEcfu_2[ECFU_COUNT][2];
static int s_tempEcfu_3[ECFU_COUNT][2];
static int s_tempEcfu_4[ECFU_COUNT][2];
static int s_tempEcfuCount_1 = 0;
static int s_tempEcfuCount_2 = 0;
static int s_tempEcfuCount_3 = 0;
static int s_tempEcfuCount_4 = 0;
#endif
#endif
/*******************************************************************/
static void dispatchUssd (Parcel& p, RequestInfo *pRI); /* MTK */
static void dispatchVoid (Parcel& p, RequestInfo *pRI);
static void dispatchString (Parcel& p, RequestInfo *pRI);
static void dispatchStrings (Parcel& p, RequestInfo *pRI);
static void dispatchInts (Parcel& p, RequestInfo *pRI);
static void dispatchDial (Parcel& p, RequestInfo *pRI);
static void dispatchSIM_IO (Parcel& p, RequestInfo *pRI);
static void dispatchCallForward(Parcel& p, RequestInfo *pRI);
static void dispatchRaw(Parcel& p, RequestInfo *pRI);
static void dispatchSmsWrite (Parcel &p, RequestInfo *pRI);
static void dispatchDataCall (Parcel& p, RequestInfo *pRI);
static void dispatchCdmaSms(Parcel &p, RequestInfo *pRI);
static void dispatchCdmaSmsAck(Parcel &p, RequestInfo *pRI);
static void dispatchGsmBrSmsCnf(Parcel &p, RequestInfo *pRI);
static void dispatchCdmaBrSmsCnf(Parcel &p, RequestInfo *pRI);
static void dispatchRilCdmaSmsWriteArgs(Parcel &p, RequestInfo *pRI);
static void dispatchPhbEntry(Parcel &p, RequestInfo *pRI);
static void dispatchWritePhbEntryExt(Parcel &p, RequestInfo *pRI);
//[New R8 modem FD]
static void dispatchFD_Mode(Parcel &p, RequestInfo *pRI);
static int responseUssdStrings(Parcel &p, void *response, size_t responselen);
static int responseInts(Parcel &p, void *response, size_t responselen);
static int responseStrings(Parcel &p, void *response, size_t responselen);
static int responseString(Parcel &p, void *response, size_t responselen);
static int responseVoid(Parcel &p, void *response, size_t responselen);
static int responseCallList(Parcel &p, void *response, size_t responselen);
static int responseSMS(Parcel &p, void *response, size_t responselen);
static int responseSIM_IO(Parcel &p, void *response, size_t responselen);
static int responseCallForwards(Parcel &p, void *response, size_t responselen);
static int responseDataCallList(Parcel &p, void *response, size_t responselen);
static int responseSetupDataCall(Parcel &p, void *response, size_t responselen);
static int responseRaw(Parcel &p, void *response, size_t responselen);
static int responseSsn(Parcel &p, void *response, size_t responselen);
static int responseCrssN(Parcel &p, void *response, size_t responselen);
static int responseSimStatus(Parcel &p, void *response, size_t responselen);
static int responseGsmBrSmsCnf(Parcel &p, void *response, size_t responselen);
static int responseCdmaBrSmsCnf(Parcel &p, void *response, size_t responselen);
static int responseCdmaSms(Parcel &p, void *response, size_t responselen);
static int responseCellList(Parcel &p, void *response, size_t responselen);
static int responseCdmaInformationRecords(Parcel &p,void *response, size_t responselen);
static int responseRilSignalStrength(Parcel &p,void *response, size_t responselen);
static int responseCallRing(Parcel &p, void *response, size_t responselen);
static int responseCdmaSignalInfoRecord(Parcel &p,void *response, size_t responselen);
static int responseCdmaCallWaiting(Parcel &p,void *response, size_t responselen);
static int responsePhbEntries(Parcel &p,void *response, size_t responselen);
static int responseGetSmsSimMemStatusCnf(Parcel &p,void *response, size_t responselen);
static int handleSpecialRequestWithArgs(int argCount, char** args);
static int responseGetPhbMemStorage(Parcel &p,void *response, size_t responselen);
static int responseReadPhbEntryExt(Parcel &p,void *response, size_t responselen);
static void dispatchSmsParams(Parcel &p, RequestInfo *pRI);
static int responseSmsParams(Parcel &p, void *response, size_t responselen);
static int responseCbConfigInfo(Parcel &p, void *response, size_t responselen);
static int responseEtwsNotification(Parcel &p, void *response, size_t responselen);
#ifdef RIL_SHLIB
extern "C" void RIL_onUnsolicitedResponse(int unsolResponse, void *data,
size_t datalen, RILId id);
#endif
static UserCallbackInfo * internalRequestTimedCallback
(RIL_TimedCallback callback, void *param,
const struct timeval *relativeTime);
#ifdef MTK_RIL
static UserCallbackInfo * internalRequestProxyTimedCallback
(RIL_TimedCallback callback, void *param,
const struct timeval *relativeTime, int proxyId);
static AtResponseList* pendedUrcList1 = NULL;
#ifdef MTK_GEMINI
static AtResponseList* pendedUrcList2 = NULL;
#endif /* MTK_GEMINI */
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
static AtResponseList* pendedUrcList3 = NULL;
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
static AtResponseList* pendedUrcList4 = NULL;
#endif
#endif /*MTK_RIL*/
/** Index == requestNumber */
static CommandInfo s_commands[] = {
#include "ril_commands.h"
};
static UnsolResponseInfo s_unsolResponses[] = {
#include "ril_unsol_commands.h"
};
#ifdef MTK_RIL
static CommandInfo s_mtk_commands[] = {
#include "mtk_ril_commands.h"
};
static UnsolResponseInfo s_mtk_unsolResponses[] = {
#include "mtk_ril_unsol_commands.h"
};
static CommandInfo s_mtk_local_commands[] = {
#include "mtk_ril_local_commands.h"
};
#endif /* MTK_RIL */
static void
printRILData(const void *data, size_t len)
{
unsigned int i;
char *pBuf = (char *) data;
for (i=0; i <= (len - 1)/16; i++)
{
LOGI("%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X",
pBuf[16*i],pBuf[16*i+1],pBuf[16*i+2],pBuf[16*i+3],pBuf[16*i+4],pBuf[16*i+5],pBuf[16*i+6],pBuf[16*i+7],
pBuf[16*i+8],pBuf[16*i+9],pBuf[16*i+10],pBuf[16*i+11],pBuf[16*i+12],pBuf[16*i+13],pBuf[16*i+14],pBuf[16*i+15]);
}
}
static char *
strdupReadString(Parcel &p) {
size_t stringlen;
const char16_t *s16;
s16 = p.readString16Inplace(&stringlen);
return strndup16to8(s16, stringlen);
}
static void writeStringToParcel(Parcel &p, const char *s) {
char16_t *s16;
size_t s16_len;
s16 = strdup8to16(s, &s16_len);
p.writeString16(s16, s16_len);
free(s16);
}
static void
memsetString (char *s) {
if (s != NULL) {
memset (s, 0, strlen(s));
}
}
void nullParcelReleaseFunction (const uint8_t* data, size_t dataSize,
const size_t* objects, size_t objectsSize,
void* cookie) {
// do nothing -- the data reference lives longer than the Parcel object
}
/**
* To be called from dispatch thread
* Issue a single local request, ensuring that the response
* is not sent back up to the command process
*/
static void
issueLocalRequest(int request, void *data, int len) {
RequestInfo *pRI;
int ret;
pRI = (RequestInfo *)calloc(1, sizeof(RequestInfo));
pRI->local = 1;
pRI->token = 0xffffffff; // token is not used in this context
if (request < 1 || request > (int32_t)NUM_ELEMS(s_commands)) {
#ifdef MTK_RIL
if (request >= (RIL_REQUEST_MTK_BASE + (int32_t)NUM_ELEMS(s_mtk_commands)))
#endif /* MTK_RIL */
{
LOGE("issueLocalRequest: unsupported request code %d", request);
// FIXME this should perhaps return a response
return;
}
}
#ifdef MTK_RIL
if (request < RIL_REQUEST_MTK_BASE) {
pRI->pCI = &(s_commands[request]);
} else {
pRI->pCI = &(s_mtk_commands[request - RIL_REQUEST_MTK_BASE]);
}
#else
pRI->pCI = &(s_commands[request]);
#endif /* MTK_RIL */
ret = pthread_mutex_lock(&s_pendingRequestsMutex);
assert (ret == 0);
pRI->p_next = s_pendingRequests;
s_pendingRequests = pRI;
ret = pthread_mutex_unlock(&s_pendingRequestsMutex);
assert (ret == 0);
LOGD("C[locl]> %s", requestToString(request));
s_callbacks.onRequest(request, data, len, pRI);
}
/**
* To be called from dispatch thread
* Issue a single local request for specified SIM,
* and sent back up to the command process
*/
extern "C"
void issueLocalRequestForResponse(int request, void *data, int len, RILId id) {
RequestInfo *pRI;
int ret;
status_t status;
pRI = (RequestInfo *)calloc(1, sizeof(RequestInfo));
pRI->local = 0;
if (request < 1 || request > (int32_t)NUM_ELEMS(s_commands)) {
#ifdef MTK_RIL
if (request < RIL_REQUEST_MTK_BASE || request >= (RIL_REQUEST_MTK_BASE + (int32_t)NUM_ELEMS(s_mtk_commands)))
#endif /* MTK_RIL */
{
#ifdef MTK_EAP_SIM_AKA
if(request < RIL_LOCAL_REQUEST_MTK_BASE || request >= (RIL_LOCAL_REQUEST_MTK_BASE + (int32_t)NUM_ELEMS(s_mtk_local_commands)))
#endif
{
LOGE("issueLocalRequestForResponse: unsupported request code %d", request);
// FIXME this should perhaps return a response
return;
}
}
}
#ifdef MTK_RIL
if (request >= RIL_LOCAL_REQUEST_MTK_BASE){
pRI->pCI = &(s_mtk_local_commands[request - RIL_LOCAL_REQUEST_MTK_BASE]);
}else if(request < RIL_REQUEST_MTK_BASE) {
pRI->pCI = &(s_commands[request]);
} else {
pRI->pCI = &(s_mtk_commands[request - RIL_REQUEST_MTK_BASE]);
}
#else
pRI->pCI = &(s_commands[request]);
#endif /* MTK_RIL */
#ifdef MTK_GEMINI
if (id == MTK_RIL_SOCKET_1){
pRI->cid = RIL_CMD_PROXY_1;
ret = pthread_mutex_lock(&s_pendingRequestsMutex);
assert (ret == 0);
pRI->p_next = s_pendingRequests;
s_pendingRequests = pRI;
ret = pthread_mutex_unlock(&s_pendingRequestsMutex);
assert (ret == 0);
}else if(id == MTK_RIL_SOCKET_2){
pRI->cid = RIL_CMD2_PROXY_1;
ret = pthread_mutex_lock(&s_pendingRequestsMutex2);
assert (ret == 0);
pRI->p_next = s_pendingRequests2;
s_pendingRequests2 = pRI;
ret = pthread_mutex_unlock(&s_pendingRequestsMutex2);
assert (ret == 0);
}
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4SIM*/
else if (id == MTK_RIL_SOCKET_4) {
pRI->cid = RIL_CMD4_PROXY_1;
ret = pthread_mutex_lock(&s_pendingRequestsMutex4);
assert (ret == 0);
pRI->p_next = s_pendingRequests4;
s_pendingRequests4 = pRI;
ret = pthread_mutex_unlock(&s_pendingRequestsMutex4);
assert (ret == 0);
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
else if (id == MTK_RIL_SOCKET_3) {
pRI->cid = RIL_CMD3_PROXY_1;
ret = pthread_mutex_lock(&s_pendingRequestsMutex3);
assert (ret == 0);
pRI->p_next = s_pendingRequests3;
s_pendingRequests3 = pRI;
ret = pthread_mutex_unlock(&s_pendingRequestsMutex3);
assert (ret == 0);
}
#endif
#else
pRI->cid = RIL_CMD_PROXY_1;
ret = pthread_mutex_lock(&s_pendingRequestsMutex);
assert (ret == 0);
pRI->p_next = s_pendingRequests;
s_pendingRequests = pRI;
ret = pthread_mutex_unlock(&s_pendingRequestsMutex);
assert (ret == 0);
#endif
LOGD("C[locl]> %s", requestToString(request));
#ifdef MTK_RIL
{
RequestInfoProxy * proxy = NULL;
int proxyId;
const char* proxyName = NULL;
int queueSize = 0;
LOGD("Prepare proxy and parcel");
proxy = (RequestInfoProxy *)calloc(1, sizeof(RequestInfoProxy));
assert(proxy);
proxy->p = new Parcel();
proxy->p_next = NULL;
proxy->pRI = pRI;
proxy->pUCI = NULL;
if(request == RIL_LOCAL_REQUEST_SIM_AUTHENTICATION){
const char** strings = (const char**)data;
LOGD("1- data: %s", strings[0]);
writeStringToParcel(*(proxy->p), strings[0]);
proxy->p->setDataPosition(0);
LOGD("2- data: %s", strings[0]);
} else if (request == RIL_LOCAL_REQUEST_USIM_AUTHENTICATION) {
const char** strings = (const char**)data;
proxy->p->writeInt32(len);
writeStringToParcel(*(proxy->p), strings[0]);
writeStringToParcel(*(proxy->p), strings[1]);
proxy->p->setDataPosition(0);
} else if (request == RIL_LOCAL_REQUEST_RILD_READ_IMSI) {
int param = *((int*)data);
LOGI("check 2: (%d,%d)", len, param);
proxy->p->writeInt32(len);
proxy->p->writeInt32(param);
proxy->p->setDataPosition(0);
} else {
int32_t token;
proxy->p->writeInt32(request);
// Local request for response will be handle specially,
// so set the token id as 0xFFFFFFFF
proxy->p->writeInt32(0xffffffff);
proxy->p->write(data, len);
status = proxy->p->readInt32(&request);
status = proxy->p->readInt32 (&token);
assert(status == NOERROR);
}
proxyId = pRI->pCI->proxyId;
#ifdef MTK_GEMINI
/* Shift proxyId if needed */
if (id == MTK_RIL_SOCKET_2 /*&& request != RIL_REQUEST_DUAL_SIM_MODE_SWITCH*/) {
proxyId = proxyId + RIL_CHANNEL_OFFSET;
/* Update */
}
#if (MTK_GEMINI_SIM_NUM >= 3)
else if (id == MTK_RIL_SOCKET_3) {
proxyId = proxyId + RIL_CHANNEL_SET3_OFFSET;
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 4)
else if (id == MTK_RIL_SOCKET_4) {
proxyId = proxyId + RIL_CHANNEL_SET4_OFFSET;
}
#endif
#endif /* MTK_GEMINI */
proxyName = ::proxyIdToString(proxyId);
/* Save dispatched proxy in RequestInfo */
proxy->pRI->cid = (RILChannelId) proxyId;
queueSize = enqueueProxyList(&s_Proxy[proxyId], proxy);
if (0 != queueSize)
{
LOGD("%s is busy. %s queued. total:%d requests pending",proxyName,requestToString(request),queueSize+1);
}
}
#else
s_callbacks.onRequest(request, data, len, pRI);
#endif
}
static int
processCommandBuffer(void *buffer, size_t buflen, RILId id) {
status_t status;
int32_t request;
int32_t token;
RequestInfo *pRI;
int ret;
Parcel p;
/* Hook for current context */
/* pendingRequestsMutextHook refer to &s_pendingRequestsMutex */
pthread_mutex_t * pendingRequestsMutexHook = &s_pendingRequestsMutex;
/* pendingRequestsHook refer to &s_pendingRequests */
RequestInfo ** pendingRequestsHook = &s_pendingRequests;
char prop_value[2]= {0};
p.setData((uint8_t *) buffer, buflen);
// status checked at end
status = p.readInt32(&request);
status = p.readInt32 (&token);
/* LOG RIL Request for debugging */
LOGI("RIL(%d) SOCKET REQUEST: %s length:%d",id+1, requestToString(request),buflen);
if (MTK_RIL_SOCKET_1 == id) {
//LOGI("RIL(%d) SOCKET REQUEST: %s length:%d",id, requestToString(request),buflen);
pendingRequestsMutexHook = &s_pendingRequestsMutex;
pendingRequestsHook = &s_pendingRequests;
}
#ifdef MTK_GEMINI
else {
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4SIM*/
if (MTK_RIL_SOCKET_4 == id) {
//LOGI("RIL(4) SOCKET REQUEST: %s length:%d",requestToString(request),buflen);
/* Update hook for MTK_RIL_SOCKET_4*/
pendingRequestsMutexHook = &s_pendingRequestsMutex4;
pendingRequestsHook = &s_pendingRequests4;
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
if (MTK_RIL_SOCKET_3 == id) {
//LOGI("RIL(3) SOCKET REQUEST: %s length:%d",requestToString(request),buflen);
/* Update hook for MTK_RIL_SOCKET_3*/
pendingRequestsMutexHook = &s_pendingRequestsMutex3;
pendingRequestsHook = &s_pendingRequests3;
}
#endif
if (MTK_RIL_SOCKET_2 == id) {
//LOGI("RIL(2) SOCKET REQUEST: %s length:%d",requestToString(request),buflen);
/* Update hook for MTK_RIL_SOCKET_2 */
pendingRequestsMutexHook = &s_pendingRequestsMutex2;
pendingRequestsHook = &s_pendingRequests2;
}
}
#endif /* MTK_GEMINI */
if (buflen <= 0) {
LOGE("invalid request buflen");
return 0;
}
printRILData((const void *)buffer, buflen);
if (status != NO_ERROR) {
LOGE("invalid request block");
return 0;
}
if (request < 1 || request >= (int32_t)NUM_ELEMS(s_commands)) {
#ifdef MTK_RIL
if (request > (RIL_REQUEST_MTK_BASE + (int32_t)NUM_ELEMS(s_mtk_commands)) ||
(request >= (int32_t)NUM_ELEMS(s_commands) &&
request < RIL_REQUEST_MTK_BASE))
#endif /* MTK_RIL */
{
LOGE("unsupported request code %d token %d", request, token);
// FIXME this should perhaps return a response
return 0;
}
}
LOGD("New command received from %s", rilIdToString(id));
pRI = (RequestInfo *)calloc(1, sizeof(RequestInfo));
pRI->token = token;
#ifdef MTK_RIL
if (request >= RIL_REQUEST_MTK_BASE) {
pRI->pCI = &(s_mtk_commands[request - RIL_REQUEST_MTK_BASE]);
}
else
#endif /* MTK_RIL */
{
pRI->pCI = &(s_commands[request]);
}
ret = pthread_mutex_lock(pendingRequestsMutexHook);
assert (ret == 0);
pRI->p_next = *pendingRequestsHook;
*pendingRequestsHook = pRI;
ret = pthread_mutex_unlock(pendingRequestsMutexHook);
assert (ret == 0);
#ifdef MTK_RIL
{
RequestInfoProxy * proxy = NULL;
int proxyId;
const char* proxyName = NULL;
int queueSize = 0;
proxy = (RequestInfoProxy *)calloc(1, sizeof(RequestInfoProxy));
proxy->p = new Parcel();
assert(proxy);
proxy->p_next = NULL;
proxy->pRI = pRI;
proxy->pUCI = NULL;
proxy->p->setData((uint8_t *) buffer, buflen);
status = proxy->p->readInt32(&request);
status = proxy->p->readInt32 (&token);
assert(status == NOERROR);
if (request < RIL_REQUEST_MTK_BASE) {
if (request > (sizeof(s_commands)/sizeof(s_commands[0]))) {
LOGE("Invalid request id, id=%d", request);
return 0;
}
proxyId = s_commands[request].proxyId;
} else {
if ((request - RIL_REQUEST_MTK_BASE) > (sizeof(s_mtk_commands)/sizeof(s_mtk_commands[0]))) {
LOGE("Invalid request id, id=%d", request);
return 0;
}
proxyId = s_mtk_commands[request - RIL_REQUEST_MTK_BASE].proxyId;
}
#ifdef MTK_GEMINI
/* Shift proxyId if needed */
if (id == MTK_RIL_SOCKET_2 /*&& request != RIL_REQUEST_DUAL_SIM_MODE_SWITCH*/) {
proxyId = proxyId + RIL_CHANNEL_OFFSET;
/* Update */
}
#if (MTK_GEMINI_SIM_NUM >= 3)
else if (id == MTK_RIL_SOCKET_3) {
proxyId = proxyId + RIL_CHANNEL_SET3_OFFSET;
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 4)
else if (id == MTK_RIL_SOCKET_4) {
proxyId = proxyId + RIL_CHANNEL_SET4_OFFSET;
}
#endif
#endif /* MTK_GEMINI */
proxyName = ::proxyIdToString(proxyId);
/* Save dispatched proxy in RequestInfo */
proxy->pRI->cid = (RILChannelId) proxyId;
queueSize = enqueueProxyList(&s_Proxy[proxyId], proxy);
if (0 != queueSize)
{
LOGD("%s is busy. %s queued. total:%d requests pending",proxyName,requestToString(request),queueSize+1);
}
}
#else
/* sLastDispatchedToken = token; */
pRI->pCI->dispatchFunction(p, pRI);
#endif
return 0;
}
static void
invalidCommandBlock (RequestInfo *pRI)
{
LOGE("invalid command block for token %d request %s",
pRI->token, requestToString(pRI->pCI->requestNumber));
}
/* USSD messages using the default alphabet are coded with the GSM 7-bit default alphabet *
* given in clause 6.2.1. The message can then consist of up to 182 user characters (3GPP 23.038) */
#define MAX_RIL_USSD_STRING_LENGTH 255
/** Callee expects const char * in UCS2 Hex decimal format */
static void
dispatchUssd (Parcel& p, RequestInfo *pRI) {
status_t status;
size_t stringlen = 0;
char* string8 = NULL;
bytes_t ucs2String = NULL;
bytes_t ucs2HexString = NULL;
string8 = strdupReadString(p);
startRequest;
appendPrintBuf("%s%s", printBuf, string8);
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
ucs2String = (bytes_t) calloc(2*(MAX_RIL_USSD_STRING_LENGTH+1),sizeof(char));
//BEGIN mtk08470 [20130109][ALPS00436983]
// memory overwrite if strlen(string8) is larger than MAX_RIL_USSD_STRING_LENGTH
stringlen = utf8_to_ucs2((cbytes_t)string8, MIN(strlen(string8), MAX_RIL_USSD_STRING_LENGTH), ucs2String);
//END mtk08470 [20130109][ALPS00436983]
ucs2HexString = (bytes_t) calloc(2*stringlen*2+1,sizeof(char));
gsm_hex_from_bytes((char *)ucs2HexString, ucs2String, 2*stringlen);
s_callbacks.onRequest(pRI->pCI->requestNumber, ucs2HexString,
sizeof(char *), pRI);
#ifdef MEMSET_FREED
memsetString(string8);
memsetString((char *) ucs2String);
memsetString((char *) ucs2HexString);
#endif
free(ucs2String);
free(string8);
free(ucs2HexString);
return;
}
/** Callee expects NULL */
static void
dispatchVoid (Parcel& p, RequestInfo *pRI) {
clearPrintBuf;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, NULL, 0, pRI);
}
/** Callee expects const char * */
static void
dispatchString (Parcel& p, RequestInfo *pRI) {
status_t status;
size_t datalen;
size_t stringlen;
char *string8 = NULL;
string8 = strdupReadString(p);
startRequest;
appendPrintBuf("%s%s", printBuf, string8);
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, string8,
sizeof(char *), pRI);
#ifdef MEMSET_FREED
memsetString(string8);
#endif
free(string8);
return;
invalid:
invalidCommandBlock(pRI);
return;
}
/** Callee expects const char ** */
static void
dispatchStrings (Parcel &p, RequestInfo *pRI) {
int32_t countStrings;
status_t status;
size_t datalen;
char **pStrings;
status = p.readInt32 (&countStrings);
if (status != NO_ERROR) {
goto invalid;
}
startRequest;
if (countStrings == 0) {
// just some non-null pointer
pStrings = (char **)alloca(sizeof(char *));
datalen = 0;
} else if (((int)countStrings) == -1) {
pStrings = NULL;
datalen = 0;
} else {
datalen = sizeof(char *) * countStrings;
pStrings = (char **)alloca(datalen);
for (int i = 0 ; i < countStrings ; i++) {
pStrings[i] = strdupReadString(p);
appendPrintBuf("%s%s,", printBuf, pStrings[i]);
}
}
removeLastChar;
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, pStrings, datalen, pRI);
if (pStrings != NULL) {
for (int i = 0 ; i < countStrings ; i++) {
#ifdef MEMSET_FREED
memsetString (pStrings[i]);
#endif
free(pStrings[i]);
}
#ifdef MEMSET_FREED
memset(pStrings, 0, datalen);
#endif
}
return;
invalid:
invalidCommandBlock(pRI);
return;
}
/** Callee expects const int * */
static void
dispatchInts (Parcel &p, RequestInfo *pRI) {
int32_t count;
status_t status;
size_t datalen;
int *pInts;
status = p.readInt32 (&count);
if (status != NO_ERROR || count == 0) {
goto invalid;
}
datalen = sizeof(int) * count;
pInts = (int *)alloca(datalen);
startRequest;
for (int i = 0 ; i < count ; i++) {
int32_t t;
status = p.readInt32(&t);
pInts[i] = (int)t;
appendPrintBuf("%s%d,", printBuf, t);
if (status != NO_ERROR) {
goto invalid;
}
}
removeLastChar;
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, const_cast<int *>(pInts),
datalen, pRI);
#ifdef MEMSET_FREED
memset(pInts, 0, datalen);
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
/**
* Callee expects const RIL_SMS_WriteArgs *
* Payload is:
* int32_t status
* String pdu
*/
static void
dispatchSmsWrite (Parcel &p, RequestInfo *pRI) {
RIL_SMS_WriteArgs args;
int32_t t;
status_t status;
memset (&args, 0, sizeof(args));
status = p.readInt32(&t);
args.status = (int)t;
args.pdu = strdupReadString(p);
if (status != NO_ERROR || args.pdu == NULL) {
goto invalid;
}
args.smsc = strdupReadString(p);
startRequest;
appendPrintBuf("%s%d,%s,smsc=%s", printBuf, args.status,
(char*)args.pdu, (char*)args.smsc);
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, &args, sizeof(args), pRI);
#ifdef MEMSET_FREED
memsetString (args.pdu);
#endif
free (args.pdu);
#ifdef MEMSET_FREED
memset(&args, 0, sizeof(args));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
/**
* Callee expects const RIL_Dial *
* Payload is:
* String address
* int32_t clir
*/
static void
dispatchDial (Parcel &p, RequestInfo *pRI) {
RIL_Dial dial;
RIL_UUS_Info uusInfo;
int32_t sizeOfDial;
int32_t t;
int32_t uusPresent;
status_t status;
memset (&dial, 0, sizeof(dial));
dial.address = strdupReadString(p);
status = p.readInt32(&t);
dial.clir = (int)t;
if (status != NO_ERROR || dial.address == NULL) {
goto invalid;
}
if (s_callbacks.version < 3) { // Remove when partners upgrade to version 3
uusPresent = 0;
sizeOfDial = sizeof(dial) - sizeof(RIL_UUS_Info *);
} else {
status = p.readInt32(&uusPresent);
if (status != NO_ERROR) {
goto invalid;
}
if (uusPresent == 0) {
dial.uusInfo = NULL;
} else {
int32_t len;
memset(&uusInfo, 0, sizeof(RIL_UUS_Info));
status = p.readInt32(&t);
uusInfo.uusType = (RIL_UUS_Type) t;
status = p.readInt32(&t);
uusInfo.uusDcs = (RIL_UUS_DCS) t;
status = p.readInt32(&len);
if (status != NO_ERROR) {
goto invalid;
}
// The java code writes -1 for null arrays
if (((int) len) == -1) {
uusInfo.uusData = NULL;
len = 0;
} else {
uusInfo.uusData = (char*) p.readInplace(len);
}
uusInfo.uusLength = len;
dial.uusInfo = &uusInfo;
}
sizeOfDial = sizeof(dial);
}
startRequest;
appendPrintBuf("%snum=%s,clir=%d", printBuf, dial.address, dial.clir);
if (uusPresent) {
appendPrintBuf("%s,uusType=%d,uusDcs=%d,uusLen=%d", printBuf,
dial.uusInfo->uusType, dial.uusInfo->uusDcs,
dial.uusInfo->uusLength);
}
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, &dial, sizeOfDial, pRI);
#ifdef MEMSET_FREED
memsetString (dial.address);
#endif
free (dial.address);
#ifdef MEMSET_FREED
memset(&uusInfo, 0, sizeof(RIL_UUS_Info));
memset(&dial, 0, sizeof(dial));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
/**
* Callee expects const RIL_SIM_IO_v6 *
* Payload is:
* int32_t cla // NFC SEEK
* int32_t command
* int32_t fileid
* String path
* int32_t p1, p2, p3
* String data
* String pin2
*/
static void
dispatchSIM_IO (Parcel &p, RequestInfo *pRI) {
RIL_SIM_IO_v6 simIO;
int32_t t;
status_t status;
memset (&simIO, 0, sizeof(simIO));
// note we only check status at the end
// NFC SEEK start
simIO.cla = 0;
if(pRI->pCI->requestNumber != RIL_REQUEST_SIM_IO) {
status = p.readInt32(&t);
simIO.cla = (int)t;
}
// NFC SEEK end
status = p.readInt32(&t);
simIO.command = (int)t;
status = p.readInt32(&t);
simIO.fileid = (int)t;
simIO.path = strdupReadString(p);
status = p.readInt32(&t);
simIO.p1 = (int)t;
status = p.readInt32(&t);
simIO.p2 = (int)t;
status = p.readInt32(&t);
simIO.p3 = (int)t;
simIO.data = strdupReadString(p);
simIO.pin2 = strdupReadString(p);
startRequest;
appendPrintBuf("%scmd=0x%X,efid=0x%X,path=%s,%d,%d,%d,%s,pin2=%s", printBuf,
simIO.command, simIO.fileid, (char*)simIO.path,
simIO.p1, simIO.p2, simIO.p3,
(char*)simIO.data, (char*)simIO.pin2);
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
if (status != NO_ERROR) {
goto invalid;
}
s_callbacks.onRequest(pRI->pCI->requestNumber, &simIO, sizeof(simIO), pRI);
#ifdef MEMSET_FREED
memsetString (simIO.path);
memsetString (simIO.data);
memsetString (simIO.pin2);
#endif
free (simIO.path);
free (simIO.data);
free (simIO.pin2);
#ifdef MEMSET_FREED
memset(&simIO, 0, sizeof(simIO));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
/**
* Callee expects const RIL_CallForwardInfo *
* Payload is:
* int32_t status/action
* int32_t reason
* int32_t serviceCode
* int32_t toa
* String number (0 length -> null)
* int32_t timeSeconds
*/
static void
dispatchCallForward(Parcel &p, RequestInfo *pRI) {
RIL_CallForwardInfo cff;
int32_t t;
status_t status;
memset (&cff, 0, sizeof(cff));
// note we only check status at the end
status = p.readInt32(&t);
cff.status = (int)t;
status = p.readInt32(&t);
cff.reason = (int)t;
status = p.readInt32(&t);
cff.serviceClass = (int)t;
status = p.readInt32(&t);
cff.toa = (int)t;
cff.number = strdupReadString(p);
status = p.readInt32(&t);
cff.timeSeconds = (int)t;
if (status != NO_ERROR) {
goto invalid;
}
// special case: number 0-length fields is null
if (cff.number != NULL && strlen (cff.number) == 0) {
cff.number = NULL;
}
startRequest;
appendPrintBuf("%sstat=%d,reason=%d,serv=%d,toa=%d,%s,tout=%d", printBuf,
cff.status, cff.reason, cff.serviceClass, cff.toa,
(char*)cff.number, cff.timeSeconds);
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, &cff, sizeof(cff), pRI);
#ifdef MEMSET_FREED
memsetString(cff.number);
#endif
free (cff.number);
#ifdef MEMSET_FREED
memset(&cff, 0, sizeof(cff));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
static void
dispatchRaw(Parcel &p, RequestInfo *pRI) {
int32_t len;
status_t status;
const void *data;
status = p.readInt32(&len);
if (status != NO_ERROR) {
goto invalid;
}
// The java code writes -1 for null arrays
if (((int)len) == -1) {
data = NULL;
len = 0;
}
data = p.readInplace(len);
startRequest;
appendPrintBuf("%sraw_size=%d", printBuf, len);
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, const_cast<void *>(data), len, pRI);
return;
invalid:
invalidCommandBlock(pRI);
return;
}
static void
dispatchCdmaSms(Parcel &p, RequestInfo *pRI) {
RIL_CDMA_SMS_Message rcsm;
int32_t t;
uint8_t ut;
status_t status;
int32_t digitCount;
int digitLimit;
memset(&rcsm, 0, sizeof(rcsm));
status = p.readInt32(&t);
rcsm.uTeleserviceID = (int) t;
status = p.read(&ut,sizeof(ut));
rcsm.bIsServicePresent = (uint8_t) ut;
status = p.readInt32(&t);
rcsm.uServicecategory = (int) t;
status = p.readInt32(&t);
rcsm.sAddress.digit_mode = (RIL_CDMA_SMS_DigitMode) t;
status = p.readInt32(&t);
rcsm.sAddress.number_mode = (RIL_CDMA_SMS_NumberMode) t;
status = p.readInt32(&t);
rcsm.sAddress.number_type = (RIL_CDMA_SMS_NumberType) t;
status = p.readInt32(&t);
rcsm.sAddress.number_plan = (RIL_CDMA_SMS_NumberPlan) t;
status = p.read(&ut,sizeof(ut));
rcsm.sAddress.number_of_digits= (uint8_t) ut;
digitLimit= MIN((rcsm.sAddress.number_of_digits), RIL_CDMA_SMS_ADDRESS_MAX);
for(digitCount =0 ; digitCount < digitLimit; digitCount ++) {
status = p.read(&ut,sizeof(ut));
rcsm.sAddress.digits[digitCount] = (uint8_t) ut;
}
status = p.readInt32(&t);
rcsm.sSubAddress.subaddressType = (RIL_CDMA_SMS_SubaddressType) t;
status = p.read(&ut,sizeof(ut));
rcsm.sSubAddress.odd = (uint8_t) ut;
status = p.read(&ut,sizeof(ut));
rcsm.sSubAddress.number_of_digits = (uint8_t) ut;
digitLimit= MIN((rcsm.sSubAddress.number_of_digits), RIL_CDMA_SMS_SUBADDRESS_MAX);
for(digitCount =0 ; digitCount < digitLimit; digitCount ++) {
status = p.read(&ut,sizeof(ut));
rcsm.sSubAddress.digits[digitCount] = (uint8_t) ut;
}
status = p.readInt32(&t);
rcsm.uBearerDataLen = (int) t;
digitLimit= MIN((rcsm.uBearerDataLen), RIL_CDMA_SMS_BEARER_DATA_MAX);
for(digitCount =0 ; digitCount < digitLimit; digitCount ++) {
status = p.read(&ut, sizeof(ut));
rcsm.aBearerData[digitCount] = (uint8_t) ut;
}
if (status != NO_ERROR) {
goto invalid;
}
startRequest;
appendPrintBuf("%suTeleserviceID=%d, bIsServicePresent=%d, uServicecategory=%d, \
sAddress.digit_mode=%d, sAddress.Number_mode=%d, sAddress.number_type=%d, ",
printBuf, rcsm.uTeleserviceID,rcsm.bIsServicePresent,rcsm.uServicecategory,
rcsm.sAddress.digit_mode, rcsm.sAddress.number_mode,rcsm.sAddress.number_type);
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, &rcsm, sizeof(rcsm),pRI);
#ifdef MEMSET_FREED
memset(&rcsm, 0, sizeof(rcsm));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
static void
dispatchCdmaSmsAck(Parcel &p, RequestInfo *pRI) {
RIL_CDMA_SMS_Ack rcsa;
int32_t t;
status_t status;
int32_t digitCount;
memset(&rcsa, 0, sizeof(rcsa));
status = p.readInt32(&t);
rcsa.uErrorClass = (RIL_CDMA_SMS_ErrorClass) t;
status = p.readInt32(&t);
rcsa.uSMSCauseCode = (int) t;
if (status != NO_ERROR) {
goto invalid;
}
startRequest;
appendPrintBuf("%suErrorClass=%d, uTLStatus=%d, ",
printBuf, rcsa.uErrorClass, rcsa.uSMSCauseCode);
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, &rcsa, sizeof(rcsa),pRI);
#ifdef MEMSET_FREED
memset(&rcsa, 0, sizeof(rcsa));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
static void
dispatchGsmBrSmsCnf(Parcel &p, RequestInfo *pRI) {
int32_t t;
status_t status;
int32_t num;
status = p.readInt32(&num);
if (status != NO_ERROR) {
goto invalid;
}
RIL_GSM_BroadcastSmsConfigInfo gsmBci[num];
RIL_GSM_BroadcastSmsConfigInfo *gsmBciPtrs[num];
startRequest;
for (int i = 0 ; i < num ; i++ ) {
gsmBciPtrs[i] = &gsmBci[i];
status = p.readInt32(&t);
gsmBci[i].fromServiceId = (int) t;
status = p.readInt32(&t);
gsmBci[i].toServiceId = (int) t;
status = p.readInt32(&t);
gsmBci[i].fromCodeScheme = (int) t;
status = p.readInt32(&t);
gsmBci[i].toCodeScheme = (int) t;
status = p.readInt32(&t);
gsmBci[i].selected = (uint8_t) t;
appendPrintBuf("%s [%d: fromServiceId=%d, toServiceId =%d, \
fromCodeScheme=%d, toCodeScheme=%d, selected =%d]", printBuf, i,
gsmBci[i].fromServiceId, gsmBci[i].toServiceId,
gsmBci[i].fromCodeScheme, gsmBci[i].toCodeScheme,
gsmBci[i].selected);
}
closeRequest;
if (status != NO_ERROR) {
goto invalid;
}
s_callbacks.onRequest(pRI->pCI->requestNumber,
gsmBciPtrs,
num * sizeof(RIL_GSM_BroadcastSmsConfigInfo *),
pRI);
#ifdef MEMSET_FREED
memset(gsmBci, 0, num * sizeof(RIL_GSM_BroadcastSmsConfigInfo));
memset(gsmBciPtrs, 0, num * sizeof(RIL_GSM_BroadcastSmsConfigInfo *));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
static void
dispatchCdmaBrSmsCnf(Parcel &p, RequestInfo *pRI) {
int32_t t;
status_t status;
int32_t num;
status = p.readInt32(&num);
if (status != NO_ERROR) {
goto invalid;
}
RIL_CDMA_BroadcastSmsConfigInfo cdmaBci[num];
RIL_CDMA_BroadcastSmsConfigInfo *cdmaBciPtrs[num];
startRequest;
for (int i = 0 ; i < num ; i++ ) {
cdmaBciPtrs[i] = &cdmaBci[i];
status = p.readInt32(&t);
cdmaBci[i].service_category = (int) t;
status = p.readInt32(&t);
cdmaBci[i].language = (int) t;
status = p.readInt32(&t);
cdmaBci[i].selected = (uint8_t) t;
appendPrintBuf("%s [%d: service_category=%d, language =%d, \
entries.bSelected =%d]", printBuf, i, cdmaBci[i].service_category,
cdmaBci[i].language, cdmaBci[i].selected);
}
closeRequest;
if (status != NO_ERROR) {
goto invalid;
}
s_callbacks.onRequest(pRI->pCI->requestNumber,
cdmaBciPtrs,
num * sizeof(RIL_CDMA_BroadcastSmsConfigInfo *),
pRI);
#ifdef MEMSET_FREED
memset(cdmaBci, 0, num * sizeof(RIL_CDMA_BroadcastSmsConfigInfo));
memset(cdmaBciPtrs, 0, num * sizeof(RIL_CDMA_BroadcastSmsConfigInfo *));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
static void dispatchRilCdmaSmsWriteArgs(Parcel &p, RequestInfo *pRI) {
RIL_CDMA_SMS_WriteArgs rcsw;
int32_t t;
uint32_t ut;
uint8_t uct;
status_t status;
int32_t digitCount;
memset(&rcsw, 0, sizeof(rcsw));
status = p.readInt32(&t);
rcsw.status = t;
status = p.readInt32(&t);
rcsw.message.uTeleserviceID = (int) t;
status = p.read(&uct,sizeof(uct));
rcsw.message.bIsServicePresent = (uint8_t) uct;
status = p.readInt32(&t);
rcsw.message.uServicecategory = (int) t;
status = p.readInt32(&t);
rcsw.message.sAddress.digit_mode = (RIL_CDMA_SMS_DigitMode) t;
status = p.readInt32(&t);
rcsw.message.sAddress.number_mode = (RIL_CDMA_SMS_NumberMode) t;
status = p.readInt32(&t);
rcsw.message.sAddress.number_type = (RIL_CDMA_SMS_NumberType) t;
status = p.readInt32(&t);
rcsw.message.sAddress.number_plan = (RIL_CDMA_SMS_NumberPlan) t;
status = p.read(&uct,sizeof(uct));
rcsw.message.sAddress.number_of_digits = (uint8_t) uct;
for(digitCount = 0 ; digitCount < RIL_CDMA_SMS_ADDRESS_MAX; digitCount ++) {
status = p.read(&uct,sizeof(uct));
rcsw.message.sAddress.digits[digitCount] = (uint8_t) uct;
}
status = p.readInt32(&t);
rcsw.message.sSubAddress.subaddressType = (RIL_CDMA_SMS_SubaddressType) t;
status = p.read(&uct,sizeof(uct));
rcsw.message.sSubAddress.odd = (uint8_t) uct;
status = p.read(&uct,sizeof(uct));
rcsw.message.sSubAddress.number_of_digits = (uint8_t) uct;
for(digitCount = 0 ; digitCount < RIL_CDMA_SMS_SUBADDRESS_MAX; digitCount ++) {
status = p.read(&uct,sizeof(uct));
rcsw.message.sSubAddress.digits[digitCount] = (uint8_t) uct;
}
status = p.readInt32(&t);
rcsw.message.uBearerDataLen = (int) t;
for(digitCount = 0 ; digitCount < RIL_CDMA_SMS_BEARER_DATA_MAX; digitCount ++) {
status = p.read(&uct, sizeof(uct));
rcsw.message.aBearerData[digitCount] = (uint8_t) uct;
}
if (status != NO_ERROR) {
goto invalid;
}
startRequest;
appendPrintBuf("%sstatus=%d, message.uTeleserviceID=%d, message.bIsServicePresent=%d, \
message.uServicecategory=%d, message.sAddress.digit_mode=%d, \
message.sAddress.number_mode=%d, \
message.sAddress.number_type=%d, ",
printBuf, rcsw.status, rcsw.message.uTeleserviceID, rcsw.message.bIsServicePresent,
rcsw.message.uServicecategory, rcsw.message.sAddress.digit_mode,
rcsw.message.sAddress.number_mode,
rcsw.message.sAddress.number_type);
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, &rcsw, sizeof(rcsw),pRI);
#ifdef MEMSET_FREED
memset(&rcsw, 0, sizeof(rcsw));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
// For backwards compatibility in RIL_REQUEST_SETUP_DATA_CALL.
// Version 4 of the RIL interface adds a new PDP type parameter to support
// IPv6 and dual-stack PDP contexts. When dealing with a previous version of
// RIL, remove the parameter from the request.
static void dispatchDataCall(Parcel& p, RequestInfo *pRI) {
// In RIL v3, REQUEST_SETUP_DATA_CALL takes 6 parameters.
const int numParamsRilV3 = 6;
// The first bytes of the RIL parcel contain the request number and the
// serial number - see processCommandBuffer(). Copy them over too.
int pos = p.dataPosition();
int numParams = p.readInt32();
if (s_callbacks.version < 4 && numParams > numParamsRilV3) {
Parcel p2;
p2.appendFrom(&p, 0, pos);
p2.writeInt32(numParamsRilV3);
for(int i = 0; i < numParamsRilV3; i++) {
p2.writeString16(p.readString16());
}
p2.setDataPosition(pos);
dispatchStrings(p2, pRI);
} else {
p.setDataPosition(pos);
dispatchStrings(p, pRI);
}
}
static void dispatchPhbEntry(Parcel &p, RequestInfo *pRI) {
RIL_PhbEntryStrucutre args;
int32_t t;
status_t status;
memset (&args, 0, sizeof(args));
// storage type
status = p.readInt32(&t);
args.type = (int) t;
// index of the entry
status = p.readInt32(&t);
args.index = (int) t;
// phone number
args.number = strdupReadString(p);
// Type of the number
status = p.readInt32(&t);
args.ton = (int) t;
// alpha Id
args.alphaId = strdupReadString(p);
if (status != NO_ERROR) {
goto invalid;
}
startRequest;
appendPrintBuf("%s%d,index=%d,num=%s,ton=%d,alphaId=%s", printBuf, args.type,
args.index, (char*)args.number, args.ton, (char*)args.alphaId);
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, &args, sizeof(args), pRI);
#ifdef MEMSET_FREED
memsetString (args.number);
memsetString (args.alphaId);
#endif
free (args.number);
free (args.alphaId);
#ifdef MEMSET_FREED
memset(&args, 0, sizeof(args));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
static void dispatchWritePhbEntryExt(Parcel &p, RequestInfo *pRI) {
RIL_PHB_ENTRY args;
int32_t t;
status_t status;
memset (&args, 0, sizeof(args));
// index of the entry
status = p.readInt32(&t);
args.index = (int) t;
// phone number
args.number = strdupReadString(p);
// Type of the number
status = p.readInt32(&t);
args.type = (int) t;
//text
args.text = strdupReadString(p);
//hidden
status = p.readInt32(&t);
args.hidden = (int) t;
//group
args.group = strdupReadString(p);
//anr
args.adnumber = strdupReadString(p);
// Type of the adnumber
status = p.readInt32(&t);
args.adtype = (int) t;
//SNE
args.secondtext = strdupReadString(p);
// email
args.email = strdupReadString(p);
if (status != NO_ERROR) {
goto invalid;
}
startRequest;
appendPrintBuf("%s,index=%d,num=%s,type=%d,text=%s,hidden=%d,group=%s,adnumber=%s,adtype=%d,secondtext=%s,email=%s", printBuf,
args.index, (char*)args.number, args.type, (char*)args.text,
args.hidden, (char*)args.group,(char*)args.adnumber, args.adtype,(char*)args.secondtext,(char*)args.email);
closeRequest;
printRequest(pRI->token, pRI->pCI->requestNumber);
s_callbacks.onRequest(pRI->pCI->requestNumber, &args, sizeof(args), pRI);
#ifdef MEMSET_FREED
memsetString (args.number);
memsetString (args.text);
memsetString (args.group);
memsetString (args.adnumber);
memsetString (args.secondtext);
memsetString (args.email);
#endif
free (args.number);
free (args.text);
free (args.group);
free (args.adnumber);
free (args.secondtext);
free (args.email);
#ifdef MEMSET_FREED
memset(&args, 0, sizeof(args));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
//[New R8 modem FD]
static void dispatchFD_Mode(Parcel &p, RequestInfo *pRI) {
RIL_FDModeStructure args;
status_t status;
int t_value = 0;
memset(&args, 0, sizeof(args));
status = p.readInt32(&t_value);
args.args_num = t_value;
/* AT+EFD=<mode>[,<param1>[,<param2>]] */
/* For all modes: but mode 0 & 1 only has one argument */
if (args.args_num >= 1) {
status = p.readInt32(&t_value);
args.mode = t_value;
}
/* For mode 2 & 3 */
if (args.args_num >= 2) {
status = p.readInt32(&t_value);
args.parameter1 = t_value;
}
/* Only mode 2 */
if (args.args_num >=3) {
status = p.readInt32(&t_value);
args.parameter2 = t_value;
}
s_callbacks.onRequest(pRI->pCI->requestNumber, &args, sizeof(args), pRI);
}
static int
blockingWrite(int fd, const void *buffer, size_t len) {
size_t writeOffset = 0;
const uint8_t *toWrite;
toWrite = (const uint8_t *)buffer;
while (writeOffset < len) {
ssize_t written;
do {
written = write (fd, toWrite + writeOffset,
len - writeOffset);
} while (written < 0 && errno == EINTR);
if (written >= 0) {
writeOffset += written;
} else { // written < 0
LOGE ("RIL Response: unexpected error on write errno:%d", errno);
close(fd);
return -1;
}
}
return 0;
}
static int
sendResponseRaw (const void *data, size_t dataSize, RILId id) {
int fd = *s_SocketLinterParam1.s_fdCommand;
int ret;
uint32_t header;
pthread_mutex_t * writeMutexHook = &s_writeMutex;
#ifdef MTK_GEMINI
if (MTK_RIL_SOCKET_2 == id) {
writeMutexHook = &s_writeMutex2;
fd = *s_SocketLinterParam2.s_fdCommand;
}
#if (MTK_GEMINI_SIM_NUM >= 3)
if (MTK_RIL_SOCKET_3 == id) {
writeMutexHook = &s_writeMutex3;
fd = *s_SocketLinterParam3.s_fdCommand;
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 4)
if (MTK_RIL_SOCKET_4 == id) {
writeMutexHook = &s_writeMutex4;
fd = *s_SocketLinterParam4.s_fdCommand;
}
#endif
#endif /* MTK_GEMINI */
if (fd < 0) {
LOGE("sendResponseRaw, fd < 0, fd: %d", fd);
return -1;
}
if (dataSize > MAX_COMMAND_BYTES) {
if (MTK_RIL_SOCKET_1 == id) {
LOGE("RIL1: packet larger than %u (%u)",
MAX_COMMAND_BYTES, (unsigned int )dataSize);
}
#ifdef MTK_GEMINI
else {
LOGE("RIL%d: packet larger than %u (%u)", id + 1,
MAX_COMMAND_BYTES, (unsigned int )dataSize);
}
#endif /* MTK_GEMINI */
return -1;
}
/* LOG RIL response for debugging */
printRILData(data,dataSize);
pthread_mutex_lock(writeMutexHook);
header = htonl(dataSize);
ret = blockingWrite(fd, (void *)&header, sizeof(header));
if (ret < 0) {
pthread_mutex_unlock(writeMutexHook);
#ifdef FATAL_ERROR_HANDLE
if (ret == -1) { // Socket fd was closed, reopen it.
LOGD("socket%d error", (id == MTK_RIL_SOCKET_1 ?
1 : 2));
handleRILDFatalError();
}
#endif
return ret;
}
ret = blockingWrite(fd, data, dataSize);
if (ret < 0) {
pthread_mutex_unlock(writeMutexHook);
#ifdef FATAL_ERROR_HANDLE
if (ret == -1) { // Socket fd was closed, reopen it.
LOGD("socket%d error", (id == MTK_RIL_SOCKET_1 ?
1 : 2));
handleRILDFatalError();
}
#endif
return ret;
}
pthread_mutex_unlock(writeMutexHook);
return 0;
}
static int
sendResponse (Parcel &p, RILId id) {
printResponse;
return sendResponseRaw(p.data(), p.dataSize(), id);
}
/* Convert "00 00" to "00 20" */
static int zero4_to_space(bytes_t ucs2, int ucs2len) {
int i, count = 0;
LOGI("zero4_to_space\n");
/* Ignore the last character */
for (i = 0; i < (ucs2len - 2); i+=2) {
if ((ucs2[i] == 0) && (ucs2[i+1] == 0)) {
ucs2[i+1] = 0x20; /* Space character */
count++;
}
LOGI("%d %d ", ucs2[i], ucs2[i+1]);
}
LOGI("\n");
return count;
}
/** response is a char **, pointing to an array of char *'s */
static int
responseUssdStrings(Parcel &p, void *response, size_t responselen) {
int numStrings;
const char* dcs = NULL;
bytes_t utf8String = NULL;
bytes_t hexData = NULL;
int len = 0;
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen % sizeof(char *) != 0) {
LOGE("invalid response length %d expected multiple of %d\n",
(int)responselen, (int)sizeof(char *));
return RIL_ERRNO_INVALID_RESPONSE;
}
if (response == NULL) {
p.writeInt32 (0);
} else {
char **p_cur = (char **) response;
numStrings = responselen / sizeof(char *);
if (numStrings > 1) {
/* the last string is for dcs reference */
numStrings = 2;
hexData = (bytes_t) calloc(strlen(p_cur[1]),sizeof(char));
len = gsm_hex_to_bytes((cbytes_t) p_cur[1], strlen(p_cur[1]), hexData);
if ((len < 0) || (len > MAX_RIL_USSD_STRING_LENGTH)) {
LOGE("invalid ussd response length %d expected\n",len);
free(hexData);
return RIL_ERRNO_INVALID_RESPONSE;
} else {
LOGI("Ussd string length:%d\n",len);
}
dcs = p_cur[2];
}
p.writeInt32 (numStrings);
/* each string*/
for (int i = 0 ; i < numStrings ; i++) {
if (i == 1) {
utf8String = (bytes_t) calloc(2*len+1,sizeof(char));
/* The USS strings need to be transform to utf8 */
if (!strcmp(dcs,"GSM7")) {
utf8_from_unpackedgsm7((cbytes_t) hexData, 0, len, utf8String);
} else if (!strcmp(dcs,"UCS2")) {
/* Solve CR - [ALPS00268890][SW.Pisco][Pisco][USSD]Some character can't display when receive the ussd notification, mtk04070, 2012.05.03 */
zero4_to_space(hexData, len);
ucs2_to_utf8((cbytes_t) hexData, len/2, utf8String);
} else {
utf8_from_gsm8((cbytes_t) hexData, len, utf8String);
}
writeStringToParcel(p, (const char *) utf8String);
free(hexData);
free(utf8String);
} else {
writeStringToParcel (p, p_cur[i]);
}
}
}
return 0;
}
/** response is an int* pointing to an array of ints*/
static int
responseInts(Parcel &p, void *response, size_t responselen) {
int numInts;
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen % sizeof(int) != 0) {
LOGE("invalid response length %d expected multiple of %d\n",
(int)responselen, (int)sizeof(int));
return RIL_ERRNO_INVALID_RESPONSE;
}
int *p_int = (int *) response;
numInts = responselen / sizeof(int *);
p.writeInt32 (numInts);
/* each int*/
startResponse;
for (int i = 0 ; i < numInts ; i++) {
appendPrintBuf("%s%d,", printBuf, p_int[i]);
p.writeInt32(p_int[i]);
}
removeLastChar;
closeResponse;
return 0;
}
/** response is a char **, pointing to an array of char *'s
The parcel will begin with the version */
static int responseStringsWithVersion(int version, Parcel &p, void *response, size_t responselen) {
p.writeInt32(version);
return responseStrings(p, response, responselen);
}
/** response is a char **, pointing to an array of char *'s */
static int responseStrings(Parcel &p, void *response, size_t responselen) {
int numStrings;
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen % sizeof(char *) != 0) {
LOGE("invalid response length %d expected multiple of %d\n",
(int)responselen, (int)sizeof(char *));
return RIL_ERRNO_INVALID_RESPONSE;
}
if (response == NULL) {
p.writeInt32 (0);
} else {
char **p_cur = (char **) response;
numStrings = responselen / sizeof(char *);
p.writeInt32 (numStrings);
/* each string*/
startResponse;
for (int i = 0 ; i < numStrings ; i++) {
appendPrintBuf("%s%s,", printBuf, (char*)p_cur[i]);
writeStringToParcel (p, p_cur[i]);
}
removeLastChar;
closeResponse;
}
return 0;
}
/**
* NULL strings are accepted
* FIXME currently ignores responselen
*/
static int responseString(Parcel &p, void *response, size_t responselen) {
/* one string only */
startResponse;
appendPrintBuf("%s%s", printBuf, (char*)response);
closeResponse;
writeStringToParcel(p, (const char *)response);
return 0;
}
static int responseVoid(Parcel &p, void *response, size_t responselen) {
startResponse;
removeLastChar;
return 0;
}
static int responseCallList(Parcel &p, void *response, size_t responselen) {
int num;
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen % sizeof (RIL_Call *) != 0) {
LOGE("invalid response length %d expected multiple of %d\n",
(int)responselen, (int)sizeof (RIL_Call *));
return RIL_ERRNO_INVALID_RESPONSE;
}
startResponse;
/* number of call info's */
num = responselen / sizeof(RIL_Call *);
p.writeInt32(num);
for (int i = 0 ; i < num ; i++) {
RIL_Call *p_cur = ((RIL_Call **) response)[i];
/* each call info */
p.writeInt32(p_cur->state);
p.writeInt32(p_cur->index);
p.writeInt32(p_cur->toa);
p.writeInt32(p_cur->isMpty);
p.writeInt32(p_cur->isMT);
p.writeInt32(p_cur->als);
p.writeInt32(p_cur->isVoice);
p.writeInt32(p_cur->isVoicePrivacy);
writeStringToParcel(p, p_cur->number);
p.writeInt32(p_cur->numberPresentation);
writeStringToParcel(p, p_cur->name);
p.writeInt32(p_cur->namePresentation);
// Remove when partners upgrade to version 3
if ((s_callbacks.version < 3) || (p_cur->uusInfo == NULL || p_cur->uusInfo->uusData == NULL)) {
p.writeInt32(0); /* UUS Information is absent */
} else {
RIL_UUS_Info *uusInfo = p_cur->uusInfo;
p.writeInt32(1); /* UUS Information is present */
p.writeInt32(uusInfo->uusType);
p.writeInt32(uusInfo->uusDcs);
p.writeInt32(uusInfo->uusLength);
p.write(uusInfo->uusData, uusInfo->uusLength);
}
appendPrintBuf("%s[id=%d,%s,toa=%d,",
printBuf,
p_cur->index,
callStateToString(p_cur->state),
p_cur->toa);
appendPrintBuf("%s%s,%s,als=%d,%s,%s,",
printBuf,
(p_cur->isMpty)?"conf":"norm",
(p_cur->isMT)?"mt":"mo",
p_cur->als,
(p_cur->isVoice)?"voc":"nonvoc",
(p_cur->isVoicePrivacy)?"evp":"noevp");
appendPrintBuf("%s%s,cli=%d,name='%s',%d]",
printBuf,
p_cur->number,
p_cur->numberPresentation,
p_cur->name,
p_cur->namePresentation);
}
removeLastChar;
closeResponse;
return 0;
}
static int responseSMS(Parcel &p, void *response, size_t responselen) {
if (response == NULL) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen != sizeof (RIL_SMS_Response) ) {
LOGE("invalid response length %d expected %d",
(int)responselen, (int)sizeof (RIL_SMS_Response));
return RIL_ERRNO_INVALID_RESPONSE;
}
RIL_SMS_Response *p_cur = (RIL_SMS_Response *) response;
p.writeInt32(p_cur->messageRef);
writeStringToParcel(p, p_cur->ackPDU);
p.writeInt32(p_cur->errorCode);
startResponse;
appendPrintBuf("%s%d,%s,%d", printBuf, p_cur->messageRef,
(char*)p_cur->ackPDU, p_cur->errorCode);
closeResponse;
return 0;
}
static void dispatchSmsParams(Parcel &p, RequestInfo *pRI) {
RIL_SmsParams smsParams;
int32_t t;
status_t status;
LOGD("dispatchSmsParams Enter.");
memset(&smsParams, 0, sizeof(smsParams));
status = p.readInt32(&t);
if (status != NO_ERROR) {
goto invalid;
}
status = p.readInt32(&t);
smsParams.format = t;
if (status != NO_ERROR) {
goto invalid;
}
status = p.readInt32(&t);
smsParams.vp = t;
if (status != NO_ERROR) {
goto invalid;
}
status = p.readInt32(&t);
smsParams.pid = t;
if (status != NO_ERROR) {
goto invalid;
}
status = p.readInt32(&t);
smsParams.dcs = t;
if (status != NO_ERROR) {
goto invalid;
}
LOGD("dispatchSmsParams format: %d", smsParams.format);
LOGD("dispatchSmsParams vp: %d", smsParams.vp);
LOGD("dispatchSmsParams pid: %d", smsParams.pid);
LOGD("dispatchSmsParams dcs: %d", smsParams.dcs);
LOGD("dispatchSmsParams Send Request..");
startRequest;
appendPrintBuf("%sformat=%d,vp=%d,pid=%d,dcs=%d", printBuf,
smsParams.format, smsParams.vp, smsParams.pid, smsParams.dcs);
closeRequest;
s_callbacks.onRequest(pRI->pCI->requestNumber, &smsParams, sizeof(smsParams), pRI);
#ifdef MEMSET_FREED
memset(&smsParams, 0, sizeof(smsParams));
#endif
return;
invalid:
invalidCommandBlock(pRI);
return;
}
static int responseSmsParams(Parcel &p, void *response, size_t responselen) {
if(response == NULL) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if(responselen != (int)sizeof(RIL_SmsParams)) {
LOGE("invalid response length %d expected %d",
(int)responselen, (int)sizeof(RIL_SmsParams));
return RIL_ERRNO_INVALID_RESPONSE;
}
RIL_SmsParams *p_cur = (RIL_SmsParams *)response;
p.writeInt32(p_cur->format);
p.writeInt32(p_cur->vp);
p.writeInt32(p_cur->pid);
p.writeInt32(p_cur->dcs);
startResponse;
appendPrintBuf("%s%d,%d,%d,%d", printBuf, p_cur->format, p_cur->vp,
p_cur->pid, p_cur->dcs);
closeResponse;
return 0;
}
static int responseDataCallListV4(Parcel &p, void *response, size_t responselen)
{
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen % sizeof(RIL_Data_Call_Response_v4) != 0) {
LOGE("invalid response length %d expected multiple of %d",
(int)responselen, (int)sizeof(RIL_Data_Call_Response_v4));
return RIL_ERRNO_INVALID_RESPONSE;
}
int num = responselen / sizeof(RIL_Data_Call_Response_v4);
p.writeInt32(num);
RIL_Data_Call_Response_v4 *p_cur = (RIL_Data_Call_Response_v4 *) response;
startResponse;
int i;
for (i = 0; i < num; i++) {
p.writeInt32(p_cur[i].cid);
p.writeInt32(p_cur[i].active);
writeStringToParcel(p, p_cur[i].type);
// apn is not used, so don't send.
writeStringToParcel(p, p_cur[i].address);
appendPrintBuf("%s[cid=%d,%s,%s,%s],", printBuf,
p_cur[i].cid,
(p_cur[i].active==0)?"down":"up",
(char*)p_cur[i].type,
(char*)p_cur[i].address);
}
removeLastChar;
closeResponse;
return 0;
}
static int responseDataCallList(Parcel &p, void *response, size_t responselen)
{
// Write version
p.writeInt32(s_callbacks.version);
if (s_callbacks.version < 5) {
return responseDataCallListV4(p, response, responselen);
} else {
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen % sizeof(RIL_Data_Call_Response_v6) != 0) {
LOGE("invalid response length %d expected multiple of %d",
(int)responselen, (int)sizeof(RIL_Data_Call_Response_v6));
return RIL_ERRNO_INVALID_RESPONSE;
}
int num = responselen / sizeof(RIL_Data_Call_Response_v6);
p.writeInt32(num);
RIL_Data_Call_Response_v6 *p_cur = (RIL_Data_Call_Response_v6 *) response;
startResponse;
int i;
for (i = 0; i < num; i++) {
p.writeInt32((int)p_cur[i].status);
p.writeInt32(p_cur[i].suggestedRetryTime);
p.writeInt32(p_cur[i].cid);
p.writeInt32(p_cur[i].active);
writeStringToParcel(p, p_cur[i].type);
writeStringToParcel(p, p_cur[i].ifname);
writeStringToParcel(p, p_cur[i].addresses);
writeStringToParcel(p, p_cur[i].dnses);
writeStringToParcel(p, p_cur[i].gateways);
appendPrintBuf("%s[status=%d,retry=%d,cid=%d,%s,%d,%s,%s,%s],", printBuf,
p_cur[i].status,
p_cur[i].suggestedRetryTime,
p_cur[i].cid,
(p_cur[i].active==0)?"down":"up",
(char*)p_cur[i].ifname,
(char*)p_cur[i].addresses,
(char*)p_cur[i].dnses,
(char*)p_cur[i].gateways);
}
removeLastChar;
closeResponse;
}
return 0;
}
static int responseSetupDataCall(Parcel &p, void *response, size_t responselen)
{
LOGD("s_callbacks.version %d", s_callbacks.version);
if (s_callbacks.version < 5) {
return responseStringsWithVersion(s_callbacks.version, p, response, responselen);
} else {
return responseDataCallList(p, response, responselen);
}
}
static int responseRaw(Parcel &p, void *response, size_t responselen) {
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL with responselen != 0");
return RIL_ERRNO_INVALID_RESPONSE;
}
// The java code reads -1 size as null byte array
if (response == NULL) {
p.writeInt32(-1);
} else {
p.writeInt32(responselen);
p.write(response, responselen);
}
return 0;
}
static int responseSIM_IO(Parcel &p, void *response, size_t responselen) {
if (response == NULL) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen != sizeof (RIL_SIM_IO_Response) ) {
LOGE("invalid response length was %d expected %d",
(int)responselen, (int)sizeof (RIL_SIM_IO_Response));
return RIL_ERRNO_INVALID_RESPONSE;
}
RIL_SIM_IO_Response *p_cur = (RIL_SIM_IO_Response *) response;
p.writeInt32(p_cur->sw1);
p.writeInt32(p_cur->sw2);
writeStringToParcel(p, p_cur->simResponse);
startResponse;
appendPrintBuf("%ssw1=0x%X,sw2=0x%X,%s", printBuf, p_cur->sw1, p_cur->sw2,
(char*)p_cur->simResponse);
closeResponse;
return 0;
}
static int responseCallForwards(Parcel &p, void *response, size_t responselen) {
int num;
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen % sizeof(RIL_CallForwardInfo *) != 0) {
LOGE("invalid response length %d expected multiple of %d",
(int)responselen, (int)sizeof(RIL_CallForwardInfo *));
return RIL_ERRNO_INVALID_RESPONSE;
}
/* number of call info's */
num = responselen / sizeof(RIL_CallForwardInfo *);
p.writeInt32(num);
startResponse;
for (int i = 0 ; i < num ; i++) {
RIL_CallForwardInfo *p_cur = ((RIL_CallForwardInfo **) response)[i];
p.writeInt32(p_cur->status);
p.writeInt32(p_cur->reason);
p.writeInt32(p_cur->serviceClass);
p.writeInt32(p_cur->toa);
writeStringToParcel(p, p_cur->number);
p.writeInt32(p_cur->timeSeconds);
appendPrintBuf("%s[%s,reason=%d,cls=%d,toa=%d,%s,tout=%d],", printBuf,
(p_cur->status==1)?"enable":"disable",
p_cur->reason, p_cur->serviceClass, p_cur->toa,
(char*)p_cur->number,
p_cur->timeSeconds);
}
removeLastChar;
closeResponse;
return 0;
}
static int responseSsn(Parcel &p, void *response, size_t responselen) {
if (response == NULL) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen != sizeof(RIL_SuppSvcNotification)) {
LOGE("invalid response length was %d expected %d",
(int)responselen, (int)sizeof (RIL_SuppSvcNotification));
return RIL_ERRNO_INVALID_RESPONSE;
}
RIL_SuppSvcNotification *p_cur = (RIL_SuppSvcNotification *) response;
p.writeInt32(p_cur->notificationType);
p.writeInt32(p_cur->code);
p.writeInt32(p_cur->index);
p.writeInt32(p_cur->type);
writeStringToParcel(p, p_cur->number);
startResponse;
appendPrintBuf("%s%s,code=%d,id=%d,type=%d,%s", printBuf,
(p_cur->notificationType==0)?"mo":"mt",
p_cur->code, p_cur->index, p_cur->type,
(char*)p_cur->number);
closeResponse;
return 0;
}
static int responseCrssN(Parcel &p, void *response, size_t responselen) {
if (response == NULL) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen != sizeof(RIL_CrssNotification)) {
LOGE("invalid response length was %d expected %d",
(int)responselen, (int)sizeof (RIL_CrssNotification));
return RIL_ERRNO_INVALID_RESPONSE;
}
RIL_CrssNotification *p_cur = (RIL_CrssNotification *) response;
p.writeInt32(p_cur->code);
p.writeInt32(p_cur->type);
writeStringToParcel(p, p_cur->number);
writeStringToParcel(p, p_cur->alphaid);
p.writeInt32(p_cur->cli_validity);
return 0;
}
static int responseCellList(Parcel &p, void *response, size_t responselen) {
int num;
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen % sizeof (RIL_NeighboringCell *) != 0) {
LOGE("invalid response length %d expected multiple of %d\n",
(int)responselen, (int)sizeof (RIL_NeighboringCell *));
return RIL_ERRNO_INVALID_RESPONSE;
}
startResponse;
/* number of records */
num = responselen / sizeof(RIL_NeighboringCell *);
p.writeInt32(num);
for (int i = 0 ; i < num ; i++) {
RIL_NeighboringCell *p_cur = ((RIL_NeighboringCell **) response)[i];
p.writeInt32(p_cur->rssi);
writeStringToParcel (p, p_cur->cid);
appendPrintBuf("%s[cid=%s,rssi=%d],", printBuf,
p_cur->cid, p_cur->rssi);
}
removeLastChar;
closeResponse;
return 0;
}
/**
* Marshall the signalInfoRecord into the parcel if it exists.
*/
static void marshallSignalInfoRecord(Parcel &p,
RIL_CDMA_SignalInfoRecord &p_signalInfoRecord) {
p.writeInt32(p_signalInfoRecord.isPresent);
p.writeInt32(p_signalInfoRecord.signalType);
p.writeInt32(p_signalInfoRecord.alertPitch);
p.writeInt32(p_signalInfoRecord.signal);
}
static int responseCdmaInformationRecords(Parcel &p,
void *response, size_t responselen) {
int num;
char* string8 = NULL;
int buffer_lenght;
RIL_CDMA_InformationRecord *infoRec;
int index = 0;
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen != sizeof (RIL_CDMA_InformationRecords)) {
LOGE("invalid response length %d expected multiple of %d\n",
(int)responselen, (int)sizeof (RIL_CDMA_InformationRecords *));
return RIL_ERRNO_INVALID_RESPONSE;
}
RIL_CDMA_InformationRecords *p_cur =
(RIL_CDMA_InformationRecords *) response;
num = MIN(p_cur->numberOfInfoRecs, RIL_CDMA_MAX_NUMBER_OF_INFO_RECS);
startResponse;
p.writeInt32(num);
for (int i = 0 ; i < num ; i++) {
infoRec = &p_cur->infoRec[i];
p.writeInt32(infoRec->name);
switch (infoRec->name) {
case RIL_CDMA_DISPLAY_INFO_REC:
case RIL_CDMA_EXTENDED_DISPLAY_INFO_REC:
if (infoRec->rec.display.alpha_len >
CDMA_ALPHA_INFO_BUFFER_LENGTH) {
LOGE("invalid display info response length %d \
expected not more than %d\n",
(int)infoRec->rec.display.alpha_len,
CDMA_ALPHA_INFO_BUFFER_LENGTH);
return RIL_ERRNO_INVALID_RESPONSE;
}
string8 = (char*) malloc((infoRec->rec.display.alpha_len + 1)
* sizeof(char) );
for (int i = 0 ; i < infoRec->rec.display.alpha_len ; i++) {
string8[i] = infoRec->rec.display.alpha_buf[i];
}
index = (int) infoRec->rec.display.alpha_len;
string8[index] = '\0';
writeStringToParcel(p, (const char*)string8);
free(string8);
string8 = NULL;
break;
case RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC:
case RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC:
case RIL_CDMA_CONNECTED_NUMBER_INFO_REC:
if (infoRec->rec.number.len > CDMA_NUMBER_INFO_BUFFER_LENGTH) {
LOGE("invalid display info response length %d \
expected not more than %d\n",
(int)infoRec->rec.number.len,
CDMA_NUMBER_INFO_BUFFER_LENGTH);
return RIL_ERRNO_INVALID_RESPONSE;
}
string8 = (char*) malloc((infoRec->rec.number.len + 1)
* sizeof(char) );
for (int i = 0 ; i < infoRec->rec.number.len; i++) {
string8[i] = infoRec->rec.number.buf[i];
}
index = (int) infoRec->rec.number.len;
string8[index] = '\0';
writeStringToParcel(p, (const char*)string8);
free(string8);
string8 = NULL;
p.writeInt32(infoRec->rec.number.number_type);
p.writeInt32(infoRec->rec.number.number_plan);
p.writeInt32(infoRec->rec.number.pi);
p.writeInt32(infoRec->rec.number.si);
break;
case RIL_CDMA_SIGNAL_INFO_REC:
p.writeInt32(infoRec->rec.signal.isPresent);
p.writeInt32(infoRec->rec.signal.signalType);
p.writeInt32(infoRec->rec.signal.alertPitch);
p.writeInt32(infoRec->rec.signal.signal);
appendPrintBuf("%sisPresent=%X, signalType=%X, \
alertPitch=%X, signal=%X, ",
printBuf, (int)infoRec->rec.signal.isPresent,
(int)infoRec->rec.signal.signalType,
(int)infoRec->rec.signal.alertPitch,
(int)infoRec->rec.signal.signal);
removeLastChar;
break;
case RIL_CDMA_REDIRECTING_NUMBER_INFO_REC:
if (infoRec->rec.redir.redirectingNumber.len >
CDMA_NUMBER_INFO_BUFFER_LENGTH) {
LOGE("invalid display info response length %d \
expected not more than %d\n",
(int)infoRec->rec.redir.redirectingNumber.len,
CDMA_NUMBER_INFO_BUFFER_LENGTH);
return RIL_ERRNO_INVALID_RESPONSE;
}
string8 = (char*) malloc((infoRec->rec.redir.redirectingNumber
.len + 1) * sizeof(char) );
for (int i = 0;
i < infoRec->rec.redir.redirectingNumber.len;
i++) {
string8[i] = infoRec->rec.redir.redirectingNumber.buf[i];
}
index = (int) infoRec->rec.redir.redirectingNumber.len;
string8[index] = '\0';
writeStringToParcel(p, (const char*)string8);
free(string8);
string8 = NULL;
p.writeInt32(infoRec->rec.redir.redirectingNumber.number_type);
p.writeInt32(infoRec->rec.redir.redirectingNumber.number_plan);
p.writeInt32(infoRec->rec.redir.redirectingNumber.pi);
p.writeInt32(infoRec->rec.redir.redirectingNumber.si);
p.writeInt32(infoRec->rec.redir.redirectingReason);
break;
case RIL_CDMA_LINE_CONTROL_INFO_REC:
p.writeInt32(infoRec->rec.lineCtrl.lineCtrlPolarityIncluded);
p.writeInt32(infoRec->rec.lineCtrl.lineCtrlToggle);
p.writeInt32(infoRec->rec.lineCtrl.lineCtrlReverse);
p.writeInt32(infoRec->rec.lineCtrl.lineCtrlPowerDenial);
appendPrintBuf("%slineCtrlPolarityIncluded=%d, \
lineCtrlToggle=%d, lineCtrlReverse=%d, \
lineCtrlPowerDenial=%d, ", printBuf,
(int)infoRec->rec.lineCtrl.lineCtrlPolarityIncluded,
(int)infoRec->rec.lineCtrl.lineCtrlToggle,
(int)infoRec->rec.lineCtrl.lineCtrlReverse,
(int)infoRec->rec.lineCtrl.lineCtrlPowerDenial);
removeLastChar;
break;
case RIL_CDMA_T53_CLIR_INFO_REC:
p.writeInt32((int)(infoRec->rec.clir.cause));
appendPrintBuf("%scause%d", printBuf, infoRec->rec.clir.cause);
removeLastChar;
break;
case RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC:
p.writeInt32(infoRec->rec.audioCtrl.upLink);
p.writeInt32(infoRec->rec.audioCtrl.downLink);
appendPrintBuf("%supLink=%d, downLink=%d, ", printBuf,
infoRec->rec.audioCtrl.upLink,
infoRec->rec.audioCtrl.downLink);
removeLastChar;
break;
case RIL_CDMA_T53_RELEASE_INFO_REC:
// TODO(Moto): See David Krause, he has the answer:)
LOGE("RIL_CDMA_T53_RELEASE_INFO_REC: return INVALID_RESPONSE");
return RIL_ERRNO_INVALID_RESPONSE;
default:
LOGE("Incorrect name value");
return RIL_ERRNO_INVALID_RESPONSE;
}
}
closeResponse;
return 0;
}
static int responseRilSignalStrength(Parcel &p,
void *response, size_t responselen) {
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen == sizeof (RIL_SignalStrength_v6)) {
// New RIL
RIL_SignalStrength_v6 *p_cur = ((RIL_SignalStrength_v6 *) response);
p.writeInt32(p_cur->GW_SignalStrength.signalStrength);
p.writeInt32(p_cur->GW_SignalStrength.bitErrorRate);
p.writeInt32(p_cur->CDMA_SignalStrength.dbm);
p.writeInt32(p_cur->CDMA_SignalStrength.ecio);
p.writeInt32(p_cur->EVDO_SignalStrength.dbm);
p.writeInt32(p_cur->EVDO_SignalStrength.ecio);
p.writeInt32(p_cur->EVDO_SignalStrength.signalNoiseRatio);
startResponse;
appendPrintBuf("%s[signalStrength=%d,bitErrorRate=%d,\
CDMA_SignalStrength.dbm=%d,CDMA_SignalStrength.ecio=%d,\
EVDO_SignalStrength.dbm =%d,EVDO_SignalStrength.ecio=%d,\
EVDO_SignalStrength.signalNoiseRatio=%d]",
printBuf,
p_cur->GW_SignalStrength.signalStrength,
p_cur->GW_SignalStrength.bitErrorRate,
p_cur->CDMA_SignalStrength.dbm,
p_cur->CDMA_SignalStrength.ecio,
p_cur->EVDO_SignalStrength.dbm,
p_cur->EVDO_SignalStrength.ecio,
p_cur->EVDO_SignalStrength.signalNoiseRatio);
closeResponse;
} else if (responselen % sizeof (int) == 0) {
// Old RIL deprecated
int *p_cur = (int *) response;
startResponse;
// With the Old RIL we see one or 2 integers.
size_t num = responselen / sizeof (int); // Number of integers from ril
size_t totalIntegers = 7; // Number of integers in RIL_SignalStrength
size_t i;
appendPrintBuf("%s[", printBuf);
for (i = 0; i < num; i++) {
appendPrintBuf("%s %d", printBuf, *p_cur);
p.writeInt32(*p_cur++);
}
appendPrintBuf("%s]", printBuf);
// Fill the remainder with zero's.
for (; i < totalIntegers; i++) {
p.writeInt32(0);
}
closeResponse;
} else {
LOGE("invalid response length");
return RIL_ERRNO_INVALID_RESPONSE;
}
return 0;
}
static int responseCallRing(Parcel &p, void *response, size_t responselen) {
if ((response == NULL) || (responselen == 0)) {
return responseVoid(p, response, responselen);
} else {
return responseCdmaSignalInfoRecord(p, response, responselen);
}
}
static int responseCdmaSignalInfoRecord(Parcel &p, void *response, size_t responselen) {
if (response == NULL || responselen == 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen != sizeof (RIL_CDMA_SignalInfoRecord)) {
LOGE("invalid response length %d expected sizeof (RIL_CDMA_SignalInfoRecord) of %d\n",
(int)responselen, (int)sizeof (RIL_CDMA_SignalInfoRecord));
return RIL_ERRNO_INVALID_RESPONSE;
}
startResponse;
RIL_CDMA_SignalInfoRecord *p_cur = ((RIL_CDMA_SignalInfoRecord *) response);
marshallSignalInfoRecord(p, *p_cur);
appendPrintBuf("%s[isPresent=%d,signalType=%d,alertPitch=%d\
signal=%d]",
printBuf,
p_cur->isPresent,
p_cur->signalType,
p_cur->alertPitch,
p_cur->signal);
closeResponse;
return 0;
}
static int responseCdmaCallWaiting(Parcel &p, void *response,
size_t responselen) {
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen != sizeof(RIL_CDMA_CallWaiting_v6)) {
LOGE("invalid response length %d expected %d\n",
(int)responselen, (int)sizeof(RIL_CDMA_CallWaiting_v6));
return RIL_ERRNO_INVALID_RESPONSE;
}
startResponse;
RIL_CDMA_CallWaiting_v6 *p_cur = ((RIL_CDMA_CallWaiting_v6 *) response);
writeStringToParcel (p, p_cur->number);
p.writeInt32(p_cur->numberPresentation);
writeStringToParcel (p, p_cur->name);
marshallSignalInfoRecord(p, p_cur->signalInfoRecord);
appendPrintBuf("%snumber=%s,numberPresentation=%d, name=%s,\
signalInfoRecord[isPresent=%d,signalType=%d,alertPitch=%d\
signal=%d]",
printBuf,
p_cur->number,
p_cur->numberPresentation,
p_cur->name,
p_cur->signalInfoRecord.isPresent,
p_cur->signalInfoRecord.signalType,
p_cur->signalInfoRecord.alertPitch,
p_cur->signalInfoRecord.signal);
closeResponse;
return 0;
}
static int responseSimStatus(Parcel &p, void *response, size_t responselen) {
int i;
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen % sizeof (RIL_CardStatus_v6 *) != 0) {
LOGE("invalid response length %d expected multiple of %d\n",
(int)responselen, (int)sizeof (RIL_CardStatus_v6 *));
return RIL_ERRNO_INVALID_RESPONSE;
}
RIL_CardStatus_v6 *p_cur = ((RIL_CardStatus_v6 *) response);
p.writeInt32(p_cur->card_state);
p.writeInt32(p_cur->universal_pin_state);
p.writeInt32(p_cur->gsm_umts_subscription_app_index);
p.writeInt32(p_cur->cdma_subscription_app_index);
p.writeInt32(p_cur->ims_subscription_app_index);
p.writeInt32(p_cur->num_applications);
startResponse;
for (i = 0; i < p_cur->num_applications; i++) {
p.writeInt32(p_cur->applications[i].app_type);
p.writeInt32(p_cur->applications[i].app_state);
p.writeInt32(p_cur->applications[i].perso_substate);
writeStringToParcel(p, (const char*)(p_cur->applications[i].aid_ptr));
writeStringToParcel(p, (const char*)
(p_cur->applications[i].app_label_ptr));
p.writeInt32(p_cur->applications[i].pin1_replaced);
p.writeInt32(p_cur->applications[i].pin1);
p.writeInt32(p_cur->applications[i].pin2);
appendPrintBuf("%s[app_type=%d,app_state=%d,perso_substate=%d,\
aid_ptr=%s,app_label_ptr=%s,pin1_replaced=%d,pin1=%d,pin2=%d],",
printBuf,
p_cur->applications[i].app_type,
p_cur->applications[i].app_state,
p_cur->applications[i].perso_substate,
p_cur->applications[i].aid_ptr,
p_cur->applications[i].app_label_ptr,
p_cur->applications[i].pin1_replaced,
p_cur->applications[i].pin1,
p_cur->applications[i].pin2);
}
closeResponse;
return 0;
}
static int responseGsmBrSmsCnf(Parcel &p, void *response, size_t responselen) {
int num = responselen / sizeof(RIL_GSM_BroadcastSmsConfigInfo *);
p.writeInt32(num);
startResponse;
RIL_GSM_BroadcastSmsConfigInfo **p_cur =
(RIL_GSM_BroadcastSmsConfigInfo **) response;
for (int i = 0; i < num; i++) {
p.writeInt32(p_cur[i]->fromServiceId);
p.writeInt32(p_cur[i]->toServiceId);
p.writeInt32(p_cur[i]->fromCodeScheme);
p.writeInt32(p_cur[i]->toCodeScheme);
p.writeInt32(p_cur[i]->selected);
appendPrintBuf("%s [%d: fromServiceId=%d, toServiceId=%d, \
fromCodeScheme=%d, toCodeScheme=%d, selected =%d]",
printBuf, i, p_cur[i]->fromServiceId, p_cur[i]->toServiceId,
p_cur[i]->fromCodeScheme, p_cur[i]->toCodeScheme,
p_cur[i]->selected);
}
closeResponse;
return 0;
}
static int responseCdmaBrSmsCnf(Parcel &p, void *response, size_t responselen) {
RIL_CDMA_BroadcastSmsConfigInfo **p_cur =
(RIL_CDMA_BroadcastSmsConfigInfo **) response;
int num = responselen / sizeof (RIL_CDMA_BroadcastSmsConfigInfo *);
p.writeInt32(num);
startResponse;
for (int i = 0 ; i < num ; i++ ) {
p.writeInt32(p_cur[i]->service_category);
p.writeInt32(p_cur[i]->language);
p.writeInt32(p_cur[i]->selected);
appendPrintBuf("%s [%d: srvice_category=%d, language =%d, \
selected =%d], ",
printBuf, i, p_cur[i]->service_category, p_cur[i]->language,
p_cur[i]->selected);
}
closeResponse;
return 0;
}
static int responseCdmaSms(Parcel &p, void *response, size_t responselen) {
int num;
int digitCount;
int digitLimit;
uint8_t uct;
void* dest;
LOGD("Inside responseCdmaSms");
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen != sizeof(RIL_CDMA_SMS_Message)) {
LOGE("invalid response length was %d expected %d",
(int)responselen, (int)sizeof(RIL_CDMA_SMS_Message));
return RIL_ERRNO_INVALID_RESPONSE;
}
RIL_CDMA_SMS_Message *p_cur = (RIL_CDMA_SMS_Message *) response;
p.writeInt32(p_cur->uTeleserviceID);
p.write(&(p_cur->bIsServicePresent),sizeof(uct));
p.writeInt32(p_cur->uServicecategory);
p.writeInt32(p_cur->sAddress.digit_mode);
p.writeInt32(p_cur->sAddress.number_mode);
p.writeInt32(p_cur->sAddress.number_type);
p.writeInt32(p_cur->sAddress.number_plan);
p.write(&(p_cur->sAddress.number_of_digits), sizeof(uct));
digitLimit= MIN((p_cur->sAddress.number_of_digits), RIL_CDMA_SMS_ADDRESS_MAX);
for(digitCount =0 ; digitCount < digitLimit; digitCount ++) {
p.write(&(p_cur->sAddress.digits[digitCount]),sizeof(uct));
}
p.writeInt32(p_cur->sSubAddress.subaddressType);
p.write(&(p_cur->sSubAddress.odd),sizeof(uct));
p.write(&(p_cur->sSubAddress.number_of_digits),sizeof(uct));
digitLimit= MIN((p_cur->sSubAddress.number_of_digits), RIL_CDMA_SMS_SUBADDRESS_MAX);
for(digitCount =0 ; digitCount < digitLimit; digitCount ++) {
p.write(&(p_cur->sSubAddress.digits[digitCount]),sizeof(uct));
}
digitLimit= MIN((p_cur->uBearerDataLen), RIL_CDMA_SMS_BEARER_DATA_MAX);
p.writeInt32(p_cur->uBearerDataLen);
for(digitCount =0 ; digitCount < digitLimit; digitCount ++) {
p.write(&(p_cur->aBearerData[digitCount]), sizeof(uct));
}
startResponse;
appendPrintBuf("%suTeleserviceID=%d, bIsServicePresent=%d, uServicecategory=%d, \
sAddress.digit_mode=%d, sAddress.number_mode=%d, sAddress.number_type=%d, ",
printBuf, p_cur->uTeleserviceID,p_cur->bIsServicePresent,p_cur->uServicecategory,
p_cur->sAddress.digit_mode, p_cur->sAddress.number_mode,p_cur->sAddress.number_type);
closeResponse;
return 0;
}
static int responsePhbEntries(Parcel &p,void *response, size_t responselen) {
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen % sizeof (RIL_PhbEntryStrucutre *) != 0) {
LOGE("invalid response length %d expected multiple of %d\n",
(int)responselen, (int)sizeof (RIL_PhbEntryStrucutre *));
return RIL_ERRNO_INVALID_RESPONSE;
}
int num = responselen / sizeof(RIL_PhbEntryStrucutre *);
p.writeInt32(num);
startResponse;
RIL_PhbEntryStrucutre **p_cur =
(RIL_PhbEntryStrucutre **) response;
for (int i = 0; i < num; i++) {
p.writeInt32(p_cur[i]->type);
p.writeInt32(p_cur[i]->index);
writeStringToParcel(p, p_cur[i]->number);
p.writeInt32(p_cur[i]->ton);
writeStringToParcel(p, p_cur[i]->alphaId);
appendPrintBuf("%s [%d: type=%d, index=%d, \
number=%s, ton=%d, alphaId =%s]",
printBuf, i, p_cur[i]->type, p_cur[i]->index,
p_cur[i]->number, p_cur[i]->ton,
p_cur[i]->alphaId);
}
closeResponse;
return 0;
}
static int responseReadPhbEntryExt(Parcel &p,void *response, size_t responselen)
{
if (response == NULL && responselen != 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen % sizeof (RIL_PHB_ENTRY *) != 0) {
LOGE("invalid response length %d expected multiple of %d\n",
(int)responselen, (int)sizeof (RIL_PHB_ENTRY *));
return RIL_ERRNO_INVALID_RESPONSE;
}
int num = responselen / sizeof(RIL_PHB_ENTRY *);
p.writeInt32(num);
startResponse;
RIL_PHB_ENTRY **p_cur =
(RIL_PHB_ENTRY **) response;
for (int i = 0; i < num; i++) {
p.writeInt32(p_cur[i]->index);
writeStringToParcel(p, p_cur[i]->number);
p.writeInt32(p_cur[i]->type);
writeStringToParcel(p, p_cur[i]->text);
p.writeInt32(p_cur[i]->hidden);
writeStringToParcel(p, p_cur[i]->group);
writeStringToParcel(p, p_cur[i]->adnumber);
p.writeInt32(p_cur[i]->adtype);
writeStringToParcel(p, p_cur[i]->secondtext);
writeStringToParcel(p, p_cur[i]->email);
appendPrintBuf("%s [%d: index=%d, \
number=%s, type=%d, text =%s, hidden=%d,group=%s,adnumber=%s,adtype=%d,sectext=%s,email=%s]",
printBuf, i, p_cur[i]->index,
p_cur[i]->number, p_cur[i]->type,
p_cur[i]->text, p_cur[i]->hidden,p_cur[i]->group,p_cur[i]->adnumber,
p_cur[i]->adtype,p_cur[i]->secondtext,p_cur[i]->email);
}
closeResponse;
return 0;
}
static int responseGetSmsSimMemStatusCnf(Parcel &p,void *response, size_t responselen)
{
if (response == NULL || responselen == 0) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen != sizeof (RIL_SMS_Memory_Status)) {
LOGE("invalid response length %d expected sizeof (RIL_SMS_Memory_Status) of %d\n",
(int)responselen, (int)sizeof(RIL_SMS_Memory_Status));
return RIL_ERRNO_INVALID_RESPONSE;
}
startResponse;
RIL_SMS_Memory_Status *mem_status = (RIL_SMS_Memory_Status*)response;
p.writeInt32(mem_status->used);
p.writeInt32(mem_status->total);
appendPrintBuf("%s [used = %d, total = %d]", printBuf, mem_status->used, mem_status->total);
closeResponse;
return 0;
}
static int responseGetPhbMemStorage(Parcel &p,void *response, size_t responselen)
{
if (response == NULL || responselen == 0) {
LOGE("responseGetPhbMemStorage invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if (responselen != sizeof (RIL_PHB_MEM_STORAGE_RESPONSE)) {
LOGE("invalid response length %d expected sizeof (RIL_PHB_MEM_STORAGE_RESPONSE) of %d\n",
(int)responselen, (int)sizeof(RIL_PHB_MEM_STORAGE_RESPONSE));
return RIL_ERRNO_INVALID_RESPONSE;
}
startResponse;
RIL_PHB_MEM_STORAGE_RESPONSE *mem_status = (RIL_PHB_MEM_STORAGE_RESPONSE*)response;
writeStringToParcel (p, mem_status->storage);
p.writeInt32(mem_status->used);
p.writeInt32(mem_status->total);
appendPrintBuf("%s [storage = %s, used = %d, total = %d]", printBuf, mem_status->storage, mem_status->used, mem_status->total);
closeResponse;
return 0;
}
static int responseCbConfigInfo(Parcel &p, void *response, size_t responselen) {
if(NULL == response) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if(responselen != sizeof(RIL_CBConfigInfo)) {
LOGE("invalid response length %d expected %d",
responselen, sizeof(RIL_CBConfigInfo));
return RIL_ERRNO_INVALID_RESPONSE;
}
RIL_CBConfigInfo *p_cur = (RIL_CBConfigInfo *)response;
p.writeInt32(p_cur->mode);
writeStringToParcel(p, p_cur->channelConfigInfo);
writeStringToParcel(p, p_cur->languageConfigInfo);
p.writeInt32(p_cur->isAllLanguageOn);
startResponse;
appendPrintBuf("%s%d,%s,%s,%d", printBuf, p_cur->mode, p_cur->channelConfigInfo,
p_cur->languageConfigInfo, p_cur->isAllLanguageOn);
closeResponse;
return 0;
}
static int responseEtwsNotification(Parcel &p, void *response, size_t responselen) {
if(NULL == response) {
LOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
if(responselen != sizeof(RIL_CBEtwsNotification)) {
LOGE("invalid response length %d expected %d",
responselen, sizeof(RIL_CBEtwsNotification));
return RIL_ERRNO_INVALID_RESPONSE;
}
RIL_CBEtwsNotification *p_cur = (RIL_CBEtwsNotification *)response;
p.writeInt32(p_cur->warningType);
p.writeInt32(p_cur->messageId);
p.writeInt32(p_cur->serialNumber);
writeStringToParcel(p, p_cur->plmnId);
writeStringToParcel(p, p_cur->securityInfo);
startResponse;
appendPrintBuf("%s%d,%d,%d,%s,%s", printBuf, p_cur->waringType, p_cur->messageId,
p_cur->serialNumber, p_cur->plmnId, p_cur->securityInfo);
closeResponse;
return 0;
}
static void triggerEvLoop()
{
int ret;
if (!pthread_equal(pthread_self(), s_tid_dispatch)) {
/* trigger event loop to wakeup. No reason to do this,
* if we're in the event loop thread */
do {
ret = write (s_fdWakeupWrite, " ", 1);
} while (ret < 0 && errno == EINTR);
}
}
static void rilEventAddWakeup(struct ril_event *ev)
{
ril_event_add(ev);
triggerEvLoop();
}
#ifdef FATAL_ERROR_HANDLE
static void
handleRILDFatalError() {
LOGD("handleRILDFatalError");
#ifdef MTK_RIL_MD2
property_set("mux.report.case", "6");
property_set("ctl.start", "muxreport-daemon");
#else
property_set("mux.report.case", "2");
property_set("ctl.start", "muxreport-daemon");
#endif
}
#endif
/**
* A write on the wakeup fd is done just to pop us out of select()
* We empty the buffer here and then ril_event will reset the timers on the
* way back down
*/
static void processWakeupCallback(int fd, short flags, void *param) {
char buff[16];
int ret;
LOGV("processWakeupCallback");
/* empty our wakeup socket out */
do {
ret = read(s_fdWakeupRead, &buff, sizeof(buff));
} while (ret > 0 || (ret < 0 && errno == EINTR));
}
static void onCommandsSocketClosed(RILId id) {
int ret;
RequestInfo *p_cur;
/* Hook for current context */
/* pendingRequestsMutextHook refer to &s_pendingRequestsMutex */
pthread_mutex_t * pendingRequestsMutexHook = &s_pendingRequestsMutex;
/* pendingRequestsHook refer to &s_pendingRequests */
RequestInfo ** pendingRequestsHook = &s_pendingRequests;
#ifdef MTK_GEMINI
if (MTK_RIL_SOCKET_2 == id) {
pendingRequestsMutexHook = &s_pendingRequestsMutex2;
pendingRequestsHook = &s_pendingRequests2;
}
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM */
if (MTK_RIL_SOCKET_4 == id) {
pendingRequestsMutexHook = &s_pendingRequestsMutex4;
pendingRequestsHook = &s_pendingRequests4;
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM */
if (MTK_RIL_SOCKET_3 == id) {
pendingRequestsMutexHook = &s_pendingRequestsMutex3;
pendingRequestsHook = &s_pendingRequests3;
}
#endif
#endif /* MTK_GEMINI */
/* mark pending requests as "cancelled" so we dont report responses */
ret = pthread_mutex_lock(pendingRequestsMutexHook);
assert (ret == 0);
p_cur = *pendingRequestsHook;
for (p_cur = *pendingRequestsHook
; p_cur != NULL
; p_cur = p_cur->p_next
) {
p_cur->cancelled = 1;
}
ret = pthread_mutex_unlock(pendingRequestsMutexHook);
assert (ret == 0);
#ifdef MTK_RIL
RequestInfo *pRI;
int request = RIL_REQUEST_HANGUP_ALL;
pRI = (RequestInfo *)calloc(1, sizeof(RequestInfo));
pRI->local = 1;
pRI->token = 0xffffffff;
pRI->pCI = &(s_mtk_commands[request - RIL_REQUEST_MTK_BASE]);
if (id == MTK_RIL_SOCKET_1) {
pRI->cid = RIL_CMD_PROXY_2;
}
#ifdef MTK_GEMINI
else {
pRI->cid = RIL_CMD2_PROXY_2;
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM */
if (MTK_RIL_SOCKET_4 == id)
pRI->cid = RIL_CMD2_PROXY_4;
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM */
if (MTK_RIL_SOCKET_3 == id)
pRI->cid = RIL_CMD2_PROXY_3;
#endif
}
#endif
ret = pthread_mutex_lock(pendingRequestsMutexHook);
assert (ret == 0);
pRI->p_next = *pendingRequestsHook;
*pendingRequestsHook = pRI;
ret = pthread_mutex_unlock(pendingRequestsMutexHook);
assert (ret == 0);
s_callbacks.onRequest(request, NULL, 0, pRI);
#endif
}
static void processCommandsCallback(int fd, short flags, void *param) {
RecordStream *p_rs;
void *p_record;
size_t recordlen;
int ret;
SocketListenParam *p_info;
p_info = (SocketListenParam *)param;
assert(fd == *p_info->s_fdCommand);
p_rs = p_info->p_rs;
for (;;) {
/* loop until EAGAIN/EINTR, end of stream, or other error */
ret = record_stream_get_next(p_rs, &p_record, &recordlen);
if (ret == 0 && p_record == NULL) {
LOGI("end-of-stream ril%d", p_info->rilId+1);
/* end-of-stream */
break;
} else if (ret < 0) {
break;
} else if (ret == 0) { /* && p_record != NULL */
processCommandBuffer(p_record, recordlen, p_info->rilId);
}
}
if (ret == 0 || !(errno == EAGAIN || errno == EINTR)) {
/* fatal error or end-of-stream */
if (ret != 0) {
LOGE("error on reading command socket%d errno:%d\n", p_info->rilId, errno);
} else {
LOGW("EOS. Closing command socket RIL%d.", p_info->rilId+1);
}
#ifndef REVERSE_MTK_CHANGE
if(*p_info->s_fdCommand == *p_info->s_fdUT_command)
{
LOGD("RIL UT: Closing UT command socket RIL%d.", p_info->rilId+1);
close(*p_info->s_fdUT_command);
*p_info->s_fdUT_command = -1;
ril_event_del(p_info->s_UTcommand_event);
record_stream_free(p_rs);
if (*p_info->s_fdUT_tmp_command > 0)
{
LOGD("RIL UT: restore command eventRIL%d.", p_info->rilId+1);
// restore the command event
rilEventAddWakeup(p_info->s_commands_event);
*p_info->s_fdCommand = *p_info->s_fdUT_tmp_command;
*p_info->s_fdUT_tmp_command = -1;
}
else
{
LOGD("RIL UT: restore listen eventRIL%d.", p_info->rilId+1);
// restore the listen event
rilEventAddWakeup(p_info->s_listen_event);
*p_info->s_fdCommand = -1;
}
rilEventAddWakeup(p_info->s_UTlisten_event);
}
else
#endif
{
close(*p_info->s_fdCommand);
*p_info->s_fdCommand = -1;
ril_event_del(p_info->s_commands_event);
record_stream_free(p_rs);
/* start listening for new connections again */
rilEventAddWakeup(p_info->s_listen_event);
onCommandsSocketClosed(p_info->rilId);
}
}
}
static void onNewCommandConnect(RILId id)
{
int temp_state = RADIO_TEMPSTATE_AVAILABLE;
// implicit radio state changed
RIL_onUnsolicitedResponse(RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED,
NULL, 0, id);
RIL_onUnsolicitedResponse(RIL_UNSOL_RADIO_TEMPORARILY_UNAVAILABLE,
&temp_state, sizeof(int), id);
// Send last NITZ time data, in case it was missed
if (s_lastNITZTimeData != NULL) {
sendResponseRaw(s_lastNITZTimeData, s_lastNITZTimeDataSize, id);
free(s_lastNITZTimeData);
s_lastNITZTimeData = NULL;
}
RILId primary_rilid = MTK_RIL_SOCKET_1;
#ifdef MTK_GEMINI
if (::isGeminiMode() == 1) {
#if (MTK_GEMINI_SIM_NUM == 3)
primary_rilid = MTK_RIL_SOCKET_3;
#elif (MTK_GEMINI_SIM_NUM == 4)
primary_rilid = MTK_RIL_SOCKET_4;
#else
primary_rilid = MTK_RIL_SOCKET_2;
#endif
} else {
primary_rilid = MTK_RIL_SOCKET_1;
}
#endif
LOGI("primary_rilid: %d\n", (primary_rilid+1));
if (primary_rilid == id) {
#ifdef MTK_GEMINI
int sim_status = 0;
s_callbacks.onStateRequest(id, &sim_status);
if (sim_status == -1) {
LOGI("RIL callback is not initialized, not to report SIM inserted status");
} else {
RIL_onUnsolicitedResponse(RIL_UNSOL_SIM_INSERTED_STATUS,
&sim_status, sizeof(int), id);
}
#endif
// Get version string
if (s_callbacks.getVersion != NULL) {
const char *version;
version = s_callbacks.getVersion();
LOGI("RIL Daemon version: %s\n", version);
property_set(PROPERTY_RIL_IMPL, version);
} else {
LOGI("RIL Daemon version: unavailable\n");
property_set(PROPERTY_RIL_IMPL, "unavailable");
}
}
}
static void listenCallback (int fd, short flags, void *param) {
int ret;
int err;
int is_phone_socket;
RecordStream *p_rs;
SocketListenParam *p_info;
p_info = (SocketListenParam *)param;
struct sockaddr_un peeraddr;
socklen_t socklen = sizeof (peeraddr);
struct ucred creds;
socklen_t szCreds = sizeof(creds);
struct passwd *pwd = NULL;
assert (*p_info->s_fdCommand < 0);
assert (fd == *p_info->s_fdListen);
*p_info->s_fdCommand = accept(*p_info->s_fdListen, (sockaddr *) &peeraddr, &socklen);
if (*p_info->s_fdCommand < 0 ) {
LOGE("Error on accept() errno:%d", errno);
/* start listening for new connections again */
rilEventAddWakeup(p_info->s_listen_event);
return;
}
/* check the credential of the other side and only accept socket from
* phone process
*/
errno = 0;
is_phone_socket = 0;
err = getsockopt(*p_info->s_fdCommand, SOL_SOCKET, SO_PEERCRED, &creds, &szCreds);
if (err == 0 && szCreds > 0) {
errno = 0;
pwd = getpwuid(creds.uid);
if (pwd != NULL) {
if (strcmp(pwd->pw_name, p_info->PROCESS_NAME) == 0) {
is_phone_socket = 1;
} else {
LOGE("RILD can't accept socket from process %s", pwd->pw_name);
}
} else {
LOGE("Error on getpwuid() errno: %d", errno);
}
} else {
LOGD("Error on getsockopt() errno: %d", errno);
}
if ( !is_phone_socket ) {
LOGE("RILD must accept socket from %s", p_info->PROCESS_NAME);
close(*p_info->s_fdCommand);
*p_info->s_fdCommand = -1;
onCommandsSocketClosed(p_info->rilId);
/* start listening for new connections again */
rilEventAddWakeup(p_info->s_listen_event);
return;
}
ret = fcntl(*p_info->s_fdCommand, F_SETFL, O_NONBLOCK);
if (ret < 0) {
LOGE ("Error setting O_NONBLOCK errno:%d", errno);
}
#ifdef MTK_RIL
LOGI("librilmtk: new connection RIL%d", p_info->rilId+1);
#else
LOGI("libril: new connection");
#endif /* MTK_RIL */
p_rs = record_stream_new(*p_info->s_fdCommand, MAX_COMMAND_BYTES);
p_info->p_rs = p_rs;
ril_event_set (p_info->s_commands_event, *p_info->s_fdCommand, 1,
p_info->processCommandsCallback, p_info);
rilEventAddWakeup (p_info->s_commands_event);
onNewCommandConnect(p_info->rilId);
sendPendedUrcs(p_info->rilId);
}
static void freeDebugCallbackArgs(int number, char **args) {
for (int i = 0; i < number; i++) {
if (args[i] != NULL) {
free(args[i]);
}
}
free(args);
}
static void debugCallback (int fd, short flags, void *param) {
int acceptFD, option;
struct sockaddr_un peeraddr;
socklen_t socklen = sizeof (peeraddr);
int data;
unsigned int qxdm_data[6];
const char *deactData[1] = {"1"};
char *actData[1];
RIL_Dial dialData;
int hangupData[1] = {1};
int number;
char **args;
RILId id = MTK_RIL_SOCKET_1;
char *stk_str = NULL;
acceptFD = accept (fd, (sockaddr *) &peeraddr, &socklen);
if (acceptFD < 0) {
LOGE ("error accepting on debug port: %d\n", errno);
return;
}
s_fdDebug_command = acceptFD;
if (recv(acceptFD, &number, sizeof(int), 0) != sizeof(int)) {
LOGE ("error reading on socket: number of Args: \n");
return;
}
args = (char **) malloc(sizeof(char*) * number);
LOGI ("NUMBER:%d", number);
for (int i = 0; i < number; i++) {
unsigned int len;
if (recv(acceptFD, &len, sizeof(int), 0) != sizeof(int)) {
LOGE ("error reading on socket: Len of Args: \n");
freeDebugCallbackArgs(i, args);
return;
}
// +1 for null-term
LOGI ("arg len:%d", len);
args[i] = (char *) malloc((sizeof(char) * len) + 1);
if (recv(acceptFD, args[i], sizeof(char) * len, 0)
!= (int)(sizeof(char) * len)) {
LOGE ("error reading on socket: Args[%d] \n", i);
freeDebugCallbackArgs(i, args);
return;
}
char * buf = args[i];
buf[len] = 0;
LOGI ("ARGS[%d]:%s",i, buf);
}
#ifdef MTK_EAP_SIM_AKA
if(0< handleSpecialRequestWithArgs(number, args)){
freeDebugCallbackArgs(number, args);
LOGI("Debug port: SpecialRequest return");
return;
}
#endif
switch (atoi(args[0])) {
case 0:
LOGI ("Connection on debug port: issuing reset.");
issueLocalRequest(RIL_REQUEST_RESET_RADIO, NULL, 0);
break;
case 1:
LOGI ("Connection on debug port: issuing radio power off.");
data = 0;
issueLocalRequest(RIL_REQUEST_RADIO_POWER, &data, sizeof(int));
// Close the socket
close(s_fdCommand);
s_fdCommand = -1;
break;
case 2:
LOGI ("Debug port: issuing unsolicited network change.");
RIL_onUnsolicitedResponse(RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED,
NULL, 0, id);
break;
case 3:
LOGI ("Debug port: QXDM log enable.");
qxdm_data[0] = 65536;
qxdm_data[1] = 16;
qxdm_data[2] = 1;
qxdm_data[3] = 32;
qxdm_data[4] = 0;
qxdm_data[4] = 8;
issueLocalRequest(RIL_REQUEST_OEM_HOOK_RAW, qxdm_data,
6 * sizeof(int));
break;
case 4:
LOGI ("Debug port: QXDM log disable.");
qxdm_data[0] = 65536;
qxdm_data[1] = 16;
qxdm_data[2] = 0;
qxdm_data[3] = 32;
qxdm_data[4] = 0;
qxdm_data[4] = 8;
issueLocalRequest(RIL_REQUEST_OEM_HOOK_RAW, qxdm_data,
6 * sizeof(int));
break;
case 5:
LOGI("Debug port: Radio On");
data = 1;
issueLocalRequest(RIL_REQUEST_RADIO_POWER, &data, sizeof(int));
sleep(2);
// Set network selection automatic.
issueLocalRequest(RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC, NULL, 0);
break;
case 6:
LOGI("Debug port: Setup Data Call, Apn :%s\n", args[1]);
actData[0] = args[1];
issueLocalRequest(RIL_REQUEST_SETUP_DATA_CALL, &actData,
sizeof(actData));
break;
case 7:
LOGI("Debug port: Deactivate Data Call");
issueLocalRequest(RIL_REQUEST_DEACTIVATE_DATA_CALL, &deactData,
sizeof(deactData));
break;
case 8:
LOGI("Debug port: Dial Call");
dialData.clir = 0;
dialData.address = args[1];
issueLocalRequest(RIL_REQUEST_DIAL, &dialData, sizeof(dialData));
break;
case 9:
LOGI("Debug port: Answer Call");
issueLocalRequest(RIL_REQUEST_ANSWER, NULL, 0);
break;
case 10:
LOGI("Debug port: End Call");
issueLocalRequest(RIL_REQUEST_HANGUP, &hangupData,
sizeof(hangupData));
break;
case 11:
/**
if(number == 2) {
stk_str = args[1];
LOGI("Debug port: STK URC:%s", stk_str);
RIL_onUnsolicitedResponse(RIL_UNSOL_STK_PROACTIVE_COMMAND,
stk_str, strlen(stk_str), id);
}*/
if(3 == number) {
id = (RILId)atoi(args[1]);
if(id != MTK_RIL_SOCKET_1
#ifdef MTK_GEMINI
&& id != MTK_RIL_SOCKET_2
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM */
&& id != MTK_RIL_SOCKET_4
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM */
&& id != MTK_RIL_SOCKET_3
#endif
#endif
) {
id = MTK_RIL_SOCKET_1;
}
stk_str = args[2];
LOGI("Debug port: STK URC:%s, socket id = %d", stk_str, id);
RIL_onUnsolicitedResponse(RIL_UNSOL_STK_PROACTIVE_COMMAND,
stk_str, strlen(stk_str), id);
}
break;
default:
LOGE ("Invalid request");
break;
}
freeDebugCallbackArgs(number, args);
close(acceptFD);
s_fdDebug_command = -1;
}
static void skipWhiteSpace(char **p_cur)
{
if (*p_cur == NULL) return;
while (**p_cur != '\0' && isspace(**p_cur)) {
(*p_cur)++;
}
}
static void skipNextComma(char **p_cur)
{
if (*p_cur == NULL) return;
while (**p_cur != '\0' && **p_cur != ',') {
(*p_cur)++;
}
if (**p_cur == ',') {
(*p_cur)++;
}
}
static char * nextTok(char **p_cur)
{
char *ret = NULL;
skipWhiteSpace(p_cur);
if (*p_cur == NULL) {
ret = NULL;
} else if (**p_cur == '"') {
(*p_cur)++;
ret = strsep(p_cur, "\"");
skipNextComma(p_cur);
} else {
ret = strsep(p_cur, ",");
}
return ret;
}
int at_tok_nextstr(char **p_cur, char **p_out)
{
if (*p_cur == NULL) {
return -1;
}
*p_out = nextTok(p_cur);
return 0;
}
/** returns 1 on "has more tokens" and 0 if no */
int at_tok_hasmore(char **p_cur)
{
return ! (*p_cur == NULL || **p_cur == '\0');
}
/**
* Parses the next integer in the AT response line and places it in *p_out
* returns 0 on success and -1 on fail
* updates *p_cur
* "base" is the same as the base param in strtol
*/
static int at_tok_nextint_base(char **p_cur, int *p_out, int base, int uns)
{
char *ret;
if (*p_cur == NULL) {
return -1;
}
ret = nextTok(p_cur);
if (ret == NULL) {
return -1;
} else {
long l;
char *end;
if (uns)
l = strtoul(ret, &end, base);
else
l = strtol(ret, &end, base);
*p_out = (int)l;
if (end == ret) {
return -1;
}
}
return 0;
}
/**
* Parses the next base 10 integer in the AT response line
* and places it in *p_out
* returns 0 on success and -1 on fail
* updates *p_cur
*/
int at_tok_nextint(char **p_cur, int *p_out)
{
return at_tok_nextint_base(p_cur, p_out, 10, 0);
}
static int handleSpecialRequestWithArgs(int argCount, char** args){
char *line, *cmd;
int err;
int slotId;
char *param[2];
RILId id = MTK_RIL_SOCKET_1;
char sim[2] ={0};
int sim_status = 0;
int simId3G = 0;
if (1 == argCount)
{
line = args[0];
err = at_tok_nextstr(&line,&cmd);
if (err < 0) {
goto error;
}
LOGD("handleSpecialRequestWithArgs cmd = %s", cmd);
err = at_tok_nextint(&line,&slotId);
if (err < 0) {
goto error;
}
LOGD("handleSpecialRequestWithArgs slotId = %d", slotId);
err = at_tok_nextstr(&line,¶m[0]);
if (err < 0) {
goto error;
}
#ifdef MTK_GEMINI
property_get(PROPERTY_3G_SIM, sim, "1");
simId3G = atoi(sim)-1;
if((getTelephonyMode()>=5)&&(getTelephonyMode()<=8)){
/* dual MD project ,each RIL(MD) control each SIM slot. */
LOGD("EAP SIM will connect to specific ril debug socket");
} else {
if (simId3G > 0){
s_callbacks.onStateRequest(s_ril_cntx[simId3G], &sim_status);
if(0 == slotId && sim_status >1 ){
id = s_ril_cntx[simId3G];
}else if(simId3G == slotId ){
id = s_ril_cntx[0];
}else {
id = s_ril_cntx[slotId];
}
LOGD("3G switched,sim status of MTK_RIL_SOCKET_%d is %d, id=%d",(MTK_RIL_SOCKET_1+simId3G),sim_status,id);
} else {
id = s_ril_cntx[slotId];
LOGD("id=%d",id);
}
#if 0
property_get(PROPERTY_3G_SIM, sim, CAPABILITY_3G_SIM1);
if (strcmp(sim, CAPABILITY_3G_SIM2) == 0)
is3GSwitched = 1;
LOGD("is3GSwitched %d",is3GSwitched);
//free(sim);
s_callbacks.onStateRequest(MTK_RIL_SOCKET_2, &sim_status);
LOGD("sim status of MTK_RIL_SOCKET_2 is %d",sim_status);
if((1 == slotId && sim_status > 1 && !is3GSwitched)||(0 == slotId && sim_status >1 &&is3GSwitched)){
id = MTK_RIL_SOCKET_2;
}
#endif
}
#endif /*MTK_GEMINI*/
LOGD("handleSpecialRequestWithArgs param[0] = %s", param[0]);
if (at_tok_hasmore(&line)) {
err = at_tok_nextstr(&line, ¶m[1]);
if (err < 0) {
goto error;
}
LOGD("handleSpecialRequestWithArgs param[1] = %s", param[1]);
}
if(strcmp(cmd, "EAP_SIM") == 0){
issueLocalRequestForResponse(RIL_LOCAL_REQUEST_SIM_AUTHENTICATION,¶m,1,id);
return 1;
}else if(strcmp(cmd, "EAP_AKA") == 0){
issueLocalRequestForResponse(RIL_LOCAL_REQUEST_USIM_AUTHENTICATION,¶m, 2,id);
return 1;
}
}
else
{
LOGE ("Invalid request");
}
error:
LOGE ("Invalid request");
return 1;
}
static void userTimerCallback (int fd, short flags, void *param) {
UserCallbackInfo *p_info;
p_info = (UserCallbackInfo *)param;
#ifdef MTK_RIL
if (p_info->cid > -1)
{
RequestInfoProxy * proxy = NULL;
int proxyId;
const char* proxyName = NULL;
int queueSize = 0;
proxy = (RequestInfoProxy *)calloc(1, sizeof(RequestInfoProxy));
assert(proxy);
proxy->p_next = NULL;
proxy->pRI = NULL;
proxy->pUCI = p_info;
proxyId = p_info->cid;
proxyName = ::proxyIdToString(proxyId);
/* Save dispatched proxy in RequestInfo */
queueSize = enqueueProxyList(&s_Proxy[proxyId], proxy);
if (0 != queueSize)
{
LOGD("Request timed callback to %s is busy. total:%d requests pending",
proxyName,queueSize+1);
}
}
else
{
p_info->p_callback(p_info->userParam);
}
#else
p_info->p_callback(p_info->userParam);
#endif
// FIXME generalize this...there should be a cancel mechanism
if (s_last_wake_timeout_info != NULL && s_last_wake_timeout_info == p_info) {
s_last_wake_timeout_info = NULL;
}
#ifdef MTK_RIL
if (p_info->cid < 0)
{
free(p_info);
}
#else
free(p_info);
#endif
}
#ifndef REVERSE_MTK_CHANGE
static void mtk_ut_Callback (int fd, short flags, void *param)
{
int ret;
int err;
int is_phone_socket;
RecordStream *p_rs;
int cmd_fd;
int *fdCommand, *fdUT_command;
RILId rilId = MTK_RIL_SOCKET_1;
struct ril_event *UT_listen_event;
struct ril_event *UTcommand_event;
struct ril_event *listen_event;
struct ril_event *commands_event;
void (*callback)(int, short, void *);
struct sockaddr_un peeraddr;
socklen_t socklen = sizeof (peeraddr);
struct ucred creds;
socklen_t szCreds = sizeof(creds);
struct passwd *pwd = NULL;
#ifdef MTK_GEMINI
assert (fd == s_fdUT_listen || fd == s_fdUT_listen2);
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM */
assert (fd == s_fdUT_listen4);
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM */
assert (fd == s_fdUT_listen3);
#endif
#else
assert (fd == s_fdUT_listen);
#endif
#ifdef MTK_GEMINI
if (fd == s_fdUT_listen2)
{
UT_listen_event = &s_UTlisten_event2;
UTcommand_event = &s_UTcommand_event2;
commands_event = &s_commands_event2;
listen_event = &s_listen_event2;
fdCommand = &s_fdCommand2;
fdUT_command = &s_fdUT_command2;
rilId = MTK_RIL_SOCKET_2;
callback = processCommandsCallback;
}
else
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM */
if (fd == s_fdUT_listen4)
{
UT_listen_event = &s_UTlisten_event4;
UTcommand_event = &s_UTcommand_event4;
commands_event = &s_commands_event4;
listen_event = &s_listen_event4;
fdCommand = &s_fdCommand4;
fdUT_command = &s_fdUT_command4;
rilId = MTK_RIL_SOCKET_4;
callback = processCommandsCallback;
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM */
if (fd == s_fdUT_listen2)
{
UT_listen_event = &s_UTlisten_event3;
UTcommand_event = &s_UTcommand_event3;
commands_event = &s_commands_event3;
listen_event = &s_listen_event3;
fdCommand = &s_fdCommand3;
fdUT_command = &s_fdUT_command3;
rilId = MTK_RIL_SOCKET_3;
callback = processCommandsCallback;
}
#endif
#endif
{
UT_listen_event = &s_UTlisten_event;
UTcommand_event = &s_UTcommand_event;
commands_event = &s_commands_event;
listen_event = &s_listen_event;
fdCommand = &s_fdCommand;
fdUT_command = &s_fdUT_command;
rilId = MTK_RIL_SOCKET_1;
callback = processCommandsCallback;
}
cmd_fd = accept(fd, (sockaddr *) &peeraddr, &socklen);
if (cmd_fd < 0 ) {
LOGE("Error on accept() errno:%d", errno);
/* start listening for new connections again */
rilEventAddWakeup(UT_listen_event);
return;
}
errno = 0;
ret = fcntl(cmd_fd, F_SETFL, O_NONBLOCK);
if (ret < 0) {
LOGE ("Error setting O_NONBLOCK errno:%d", errno);
}
LOGI("RIL%d UT: new connection", rilId+1 );
if((*fdCommand) >= 0)
{
int temp_state = RADIO_TEMPSTATE_UNAVAILABLE;
LOGD("RIL UT: Delete the commands_event");
// the connection is already existed
ril_event_del(commands_event);
//s_fdUT_tmp_command = s_fdCommand;
RIL_onUnsolicitedResponse(RIL_UNSOL_RADIO_TEMPORARILY_UNAVAILABLE,
&temp_state, sizeof(int), rilId);
close(*fdCommand);
}
else
{
// there is no connection
LOGD("RIL UT: Delete the listen_event");
// delete listen event first
ril_event_del(listen_event);
}
LOGD("RIL UT: Replace the commands FD");
*fdUT_command = cmd_fd;
*fdCommand = cmd_fd;
LOGD("RIL UT: Create UT events");
p_rs = record_stream_new(cmd_fd, MAX_COMMAND_BYTES);
ril_event_set (UTcommand_event, cmd_fd, 1,
callback, p_rs);
rilEventAddWakeup (UTcommand_event);
}
#endif
/* atci start */
#define MAX_DATA_SIZE 2048
static void processAtciCommandsCallback(int fd, short flags, void *param) {
LOGD("[ATCI]processAtciCommandsCallback");
int ret;
int request = RIL_REQUEST_OEM_HOOK_RAW;
int recvLen = -1;
char buffer[MAX_DATA_SIZE] = {0};
pthread_mutex_t * pendingRequestsMutexHook = &s_pendingRequestsMutex;
RequestInfo ** pendingRequestsHook = &s_pendingRequests;
int forceHandle = 0;
while(recvLen == -1) {
recvLen = recv(s_fdATCI_command, buffer, MAX_DATA_SIZE, 0);
if (recvLen == -1) {
LOGE("[ATCI] fail to receive data from ril-atci socket. errno = %d", errno);
if(errno != EAGAIN && errno != EINTR) {
break;
}
}
}
LOGD("[ATCI] data receive from atci is %s, data length is %d", buffer, recvLen);
if (strcmp(buffer, "DISC") == 0 || recvLen == -1) {
int sendLen = 0;
if(recvLen != -1) {
sendLen = send(s_fdATCI_command, buffer, recvLen, 0);
if (sendLen != recvLen) {
LOGE("[ATCI] lose data when send disc cfm to atci. errno = %d", errno);
}
} else {
LOGE("[ATCI] close ATCI due to error = %d", errno);
}
ril_event_del(&s_ATCIcommand_event);
rilEventAddWakeup (&s_ATCIlisten_event);
close(s_fdATCI_command);
s_fdATCI_command = -1;
} else {
RequestInfo *pRI;
pRI = (RequestInfo *)calloc(1, sizeof(RequestInfo));
pRI->token = 0xffffffff; // token is not used in this context
if((strcmp(buffer, "AT+CFUN=0") == 0) || (strcmp(buffer, "at+cfun=0") == 0)){
/* ALPS00306731 */
LOGE("Special Handling for AT+CFUN=0 from ATCI");
forceHandle = 1;
}
if((strcmp(buffer, "AT+CFUN=1") == 0) || (strcmp(buffer, "at+cfun=1") == 0)){
/* ALPS00314520 */
LOGE("Special Handling for AT+CFUN=1 from ATCI");
forceHandle = 1;
}
#ifdef MTK_RIL
if (request < RIL_REQUEST_MTK_BASE) {
pRI->pCI = &(s_commands[request]);
} else {
pRI->pCI = &(s_mtk_commands[request - RIL_REQUEST_MTK_BASE]);
}
#else
pRI->pCI = &(s_commands[request]);
#endif /* MTK_RIL */
pRI->cid = RIL_CMD_1;
#ifdef MTK_GEMINI
property_get("persist.service.atci.sim", simNo, NULL);
LOGD("persist.service.atci.sim> %s", simNo);
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM */
if (simNo[0] == '3') {
LOGD("CID set to SIM4");
pRI->cid = RIL_CMD4_1;
pendingRequestsMutexHook = &s_pendingRequestsMutex4;
pendingRequestsHook = &s_pendingRequests4;
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM */
if (simNo[0] == '2') {
LOGD("CID set to SIM3");
pRI->cid = RIL_CMD3_1;
pendingRequestsMutexHook = &s_pendingRequestsMutex3;
pendingRequestsHook = &s_pendingRequests3;
}
#endif
if (simNo[0] == '1') {
LOGD("CID set to SIM2");
pRI->cid = RIL_CMD2_1;
pendingRequestsMutexHook = &s_pendingRequestsMutex2;
pendingRequestsHook = &s_pendingRequests2;
}
#endif /* MTK_GEMINI */
ret = pthread_mutex_lock(pendingRequestsMutexHook);
assert (ret == 0);
pRI->p_next = *pendingRequestsHook;
*pendingRequestsHook = pRI;
ret = pthread_mutex_unlock(pendingRequestsMutexHook);
assert (ret == 0);
LOGD("C[locl]> %s", requestToString(request));
#ifdef MTK_RIL
{
RequestInfoProxy * proxy = NULL;
int proxyId;
const char* proxyName = NULL;
int queueSize = 0;
proxy = (RequestInfoProxy *)calloc(1, sizeof(RequestInfoProxy));
proxy->p = new Parcel();
assert(proxy);
recvLen++;
proxy->p_next = NULL;
proxy->pRI = pRI;
proxy->p->writeInt32(recvLen);
proxy->p->write((void*) buffer, (size_t) recvLen);
proxy->p->setDataPosition(0);
if (request < RIL_REQUEST_MTK_BASE) {
proxyId = s_commands[request].proxyId;
} else {
proxyId = s_mtk_commands[request - RIL_REQUEST_MTK_BASE].proxyId;
}
if(forceHandle == 1)
{
// ALPS00306731 send command in URC channel to prevent blocked by other command
LOGE("Force command from ATCI to be executed in RIL_CMD_PROXY_4");
proxyId = RIL_CMD_PROXY_4;
}
#ifdef MTK_GEMINI
/* Shift proxyId if needed */
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM */
if (pRI->cid == RIL_CMD4_1) {
proxyId = proxyId + RIL_CHANNEL_SET4_OFFSET;
/* Update */
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM */
if (pRI->cid == RIL_CMD3_1) {
proxyId = proxyId + RIL_CHANNEL_SET3_OFFSET;
/* Update */
}
#endif
if (pRI->cid == RIL_CMD2_1) {
proxyId = proxyId + RIL_CHANNEL_OFFSET;
/* Update */
}
#endif /* MTK_GEMINI */
proxyName = ::proxyIdToString(proxyId);
/* Save dispatched proxy in RequestInfo */
proxy->pRI->cid = (RILChannelId) proxyId;
queueSize = enqueueProxyList(&s_Proxy[proxyId], proxy);
if (0 != queueSize)
{
LOGD("%s is busy. %s queued. total:%d requests pending",proxyName,requestToString(request),queueSize+1);
}
}
#else
/* sLastDispatchedToken = token; */
pRI->pCI->dispatchFunction(p, pRI);
#endif
}
}
static void atci_Callback (int fd, short flags, void *param)
{
LOGD("[ATCI] enter atci_Callback");
int ret;
struct sockaddr_un peeraddr;
socklen_t socklen = sizeof (peeraddr);
assert (s_fdATCI_command< 0);
assert (fd == s_fdATCI_listen);
s_fdATCI_command = accept(s_fdATCI_listen, (sockaddr *) &peeraddr, &socklen);
if (s_fdATCI_command < 0 ) {
LOGE("[ATCI] Error on accept() errno:%d", errno);
/* start listening for new connections again */
rilEventAddWakeup(&s_ATCIlisten_event);
s_fdATCI_command = -1;
return;
}
LOGD("[ATCI] accept");
ret = fcntl(s_fdATCI_command, F_SETFL, O_NONBLOCK);
if (ret < 0) {
LOGE ("[ATCI] Error setting O_NONBLOCK errno:%d", errno);
}
LOGD("[ATCI] librilmtk: new rild-atci connection");
ril_event_set (&s_ATCIcommand_event, s_fdATCI_command, true,
processAtciCommandsCallback, NULL);
rilEventAddWakeup (&s_ATCIcommand_event);
}
/* atci end */
static void *
eventLoop(void *param) {
int ret;
int filedes[2];
ril_event_init();
pthread_mutex_lock(&s_startupMutex);
s_started = 1;
pthread_cond_broadcast(&s_startupCond);
pthread_mutex_unlock(&s_startupMutex);
ret = pipe(filedes);
if (ret < 0) {
LOGE("Error in pipe() errno:%d", errno);
return NULL;
}
s_fdWakeupRead = filedes[0];
s_fdWakeupWrite = filedes[1];
fcntl(s_fdWakeupRead, F_SETFL, O_NONBLOCK);
ril_event_set (&s_wakeupfd_event, s_fdWakeupRead, true,
processWakeupCallback, NULL);
rilEventAddWakeup (&s_wakeupfd_event);
// Only returns on error
ril_event_loop();
LOGE ("error in event_loop_base errno:%d", errno);
return NULL;
}
extern "C" void
RIL_startEventLoop(void) {
int ret;
pthread_attr_t attr;
#ifdef MTK_RIL
RIL_startRILProxys();
#endif /* MTK_RIL */
/* spin up eventLoop thread and wait for it to get started */
s_started = 0;
pthread_mutex_lock(&s_startupMutex);
pthread_attr_init (&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
ret = pthread_create(&s_tid_dispatch, &attr, eventLoop, NULL);
while (s_started == 0) {
pthread_cond_wait(&s_startupCond, &s_startupMutex);
}
pthread_mutex_unlock(&s_startupMutex);
if (ret < 0) {
LOGE("Failed to create dispatch thread errno:%d", errno);
return;
}
}
// Used for testing purpose only.
extern "C" void RIL_setcallbacks (const RIL_RadioFunctions *callbacks) {
memcpy(&s_callbacks, callbacks, sizeof (RIL_RadioFunctions));
}
extern "C" void
RIL_register (const RIL_RadioFunctions *callbacks) {
int ret;
int flags;
char prop_value[2]= {0};
if (callbacks == NULL || ((callbacks->version != RIL_VERSION)
&& (callbacks->version < 2))) { // Remove when partners upgrade to version 3
LOGE(
"RIL_register: RIL_RadioFunctions * null or invalid version"
" (expected %d)", RIL_VERSION);
return;
}
if (callbacks->version < RIL_VERSION) {
LOGE ("RIL_register: upgrade RIL to version %d current version=%d",
RIL_VERSION, callbacks->version);
}
if (s_registerCalled > 0) {
LOGE("RIL_register has been called more than once. "
"Subsequent call ignored");
return;
}
memcpy(&s_callbacks, callbacks, sizeof (RIL_RadioFunctions));
/* ALPS00556811: initialize earlier before s_registerCalled is set, to prevent null access in RIL_onUnsolicitedResponse */
s_SocketLinterParam1 = {
MTK_RIL_SOCKET_1,
&s_fdListen, &s_fdCommand,
&s_fdUT_command, &s_fdUT_tmp_command,
PHONE_PROCESS,
&s_commands_event, &s_listen_event,
&s_UTcommand_event, &s_UTlisten_event,
processCommandsCallback,
NULL};
#ifdef MTK_GEMINI
s_SocketLinterParam2 = {
MTK_RIL_SOCKET_2,
&s_fdListen2, &s_fdCommand2,
&s_fdUT_command2, &s_fdUT_tmp_command2,
PHONE_PROCESS,
&s_commands_event2, &s_listen_event2,
&s_UTcommand_event2, &s_UTlisten_event2,
processCommandsCallback, NULL};
#if (MTK_GEMINI_SIM_NUM >= 3)
s_SocketLinterParam3 = {
MTK_RIL_SOCKET_3,
&s_fdListen3, &s_fdCommand3,
&s_fdUT_command3, &s_fdUT_tmp_command3,
PHONE_PROCESS,
&s_commands_event3, &s_listen_event3,
&s_UTcommand_event3, &s_UTlisten_event3,
processCommandsCallback, NULL};
#endif
#if (MTK_GEMINI_SIM_NUM >= 4)
s_SocketLinterParam4 = {
MTK_RIL_SOCKET_4,
&s_fdListen4, &s_fdCommand4,
&s_fdUT_command4, &s_fdUT_tmp_command4,
PHONE_PROCESS,
&s_commands_event4, &s_listen_event4,
&s_UTcommand_event4, &s_UTlisten_event4,
processCommandsCallback, NULL};
#endif
#endif
/* ALPS00556811 END */
s_registerCalled = 1;
LOGI("s_registerCalled flag set");
// Little self-check
for (int i = 0; i < (int)NUM_ELEMS(s_commands) ; i++) {
assert(i == s_commands[i].requestNumber);
}
for (int i = 0; i < (int)NUM_ELEMS(s_unsolResponses) ; i++) {
assert(i + RIL_UNSOL_RESPONSE_BASE
== s_unsolResponses[i].requestNumber);
}
#ifdef MTK_RIL
for (int i = 0; i < (int)NUM_ELEMS(s_mtk_commands); i++ ) {
assert(i + RIL_REQUEST_MTK_BASE
== s_mtk_commands[i].requestNumber);
}
for (int i = 0; i < (int)NUM_ELEMS(s_mtk_unsolResponses) ; i ++) {
assert(i + RIL_UNSOL_MTK_BASE
== s_mtk_unsolResponses[i].requestNumber);
}
#endif /* MTK_RIL */
// New rild impl calls RIL_startEventLoop() first
// old standalone impl wants it here.
if (s_started == 0) {
RIL_startEventLoop();
}
// start listen socket
int telephonyMode = MTK_TELEPHONY_MODE;
#ifdef MTK_RIL_MD2
char* socket1 = SOCKET_NAME_RIL_MD2;
#ifdef MTK_GEMINI
char* socket2 = SOCKET_NAME_RIL2_MD2;
#endif
char* socket_debug = SOCKET_NAME_RIL_DEBUG_MD2;
char* socket_ut = SOCKET_NAME_MTK_UT_MD2;
char* socket_ut2 = SOCKET_NAME_MTK_UT_2_MD2;
char* socket_atci = SOCKET_NAME_ATCI_MD2;
#else
char* socket1 = SOCKET_NAME_RIL;
#ifdef MTK_GEMINI
char* socket2 = SOCKET_NAME_RIL2;
#endif
char* socket_debug = SOCKET_NAME_RIL_DEBUG;
char* socket_ut = SOCKET_NAME_MTK_UT;
char* socket_ut2 = SOCKET_NAME_MTK_UT_2;
char* socket_atci = SOCKET_NAME_ATCI;
#endif
s_fdListen = android_get_control_socket(socket1);
if (s_fdListen < 0) {
LOGE("Failed to get socket '%s'", socket1);
exit(-1);
}
ret = listen(s_fdListen, 4);
if (ret < 0) {
LOGE("Failed to listen on control socket '%d': %s",
s_fdListen, strerror(errno));
exit(-1);
}
/* note: non-persistent so we can accept only one connection at a time */
ril_event_set (&s_listen_event, s_fdListen, false,
listenCallback, &s_SocketLinterParam1);
rilEventAddWakeup (&s_listen_event);
#ifdef MTK_GEMINI
// start listen socket phone2
s_fdListen2 = android_get_control_socket(socket2);
if (s_fdListen2 < 0) {
LOGE("Failed to get socket '%s'", socket2);
exit(-1);
}
ret = listen(s_fdListen2, 4);
if (ret < 0) {
LOGE("Failed to listen on control socket '%d': %s",
s_fdListen2, strerror(errno));
exit(-1);
}
/* note: non-persistent so we can accept only one connection at a time */
ril_event_set (&s_listen_event2, s_fdListen2, false,
listenCallback, &s_SocketLinterParam2);
rilEventAddWakeup (&s_listen_event2);
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
// start listen socket phone3
s_fdListen3 = android_get_control_socket(SOCKET_NAME_RIL3);
if (s_fdListen3 < 0) {
LOGE("Failed to get socket '" SOCKET_NAME_RIL3 "'");
exit(-1);
}
ret = listen(s_fdListen3, 4);
if (ret < 0) {
LOGE("Failed to listen on control socket '%d': %s",
s_fdListen3, strerror(errno));
exit(-1);
}
/* note: non-persistent so we can accept only one connection at a time */
ril_event_set (&s_listen_event3, s_fdListen3, false,
listenCallback, &s_SocketLinterParam3);
rilEventAddWakeup (&s_listen_event3);
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
// start listen socket phone4
s_fdListen4 = android_get_control_socket(SOCKET_NAME_RIL4);
if (s_fdListen4 < 0) {
LOGE("Failed to get socket '" SOCKET_NAME_RIL4 "'");
exit(-1);
}
ret = listen(s_fdListen4, 4);
if (ret < 0) {
LOGE("Failed to listen on control socket '%d': %s",
s_fdListen4, strerror(errno));
exit(-1);
}
/* note: non-persistent so we can accept only one connection at a time */
ril_event_set (&s_listen_event4, s_fdListen4, false,
listenCallback, &s_SocketLinterParam4);
rilEventAddWakeup (&s_listen_event4);
#endif
#endif /* MTK_GEMINI */
#if 1
// start debug interface socket
s_fdDebug = android_get_control_socket(socket_debug);
if (s_fdDebug < 0) {
LOGE("Failed to get socket '%s' errno:%d", socket_debug, errno);
exit(-1);
}
ret = listen(s_fdDebug, 4);
if (ret < 0) {
LOGE("Failed to listen on ril debug socket '%d': %s",
s_fdDebug, strerror(errno));
exit(-1);
}
ril_event_set (&s_debug_event, s_fdDebug, true,
debugCallback, NULL);
rilEventAddWakeup (&s_debug_event);
#endif
#ifndef REVERSE_MTK_CHANGE
// start mtk_ut interface socket
s_fdUT_listen = android_get_control_socket(socket_ut);
if (s_fdUT_listen < 0) {
LOGE("Failed to get socket '%s' errno:%d", socket_ut, errno);
exit(-1);
}
ret = listen(s_fdUT_listen, 4);
if (ret < 0) {
LOGE("Failed to listen on ril mtk ut socket '%d': %s",
s_fdUT_listen, strerror(errno));
exit(-1);
}
ril_event_set (&s_UTlisten_event, s_fdUT_listen, false,
mtk_ut_Callback, NULL);
rilEventAddWakeup (&s_UTlisten_event);
#ifdef MTK_GEMINI
// start mtk_ut_2 interface socket
s_fdUT_listen2 = android_get_control_socket(socket_ut2);
if (s_fdUT_listen2 < 0) {
LOGE("Failed to get socket '%s' errno:%d", socket_ut2, errno);
exit(-1);
}
ret = listen(s_fdUT_listen2, 4);
if (ret < 0) {
LOGE("Failed to listen on ril mtk ut socket '%d': %s",
s_fdUT_listen2, strerror(errno));
exit(-1);
}
ril_event_set (&s_UTlisten_event2, s_fdUT_listen2, false,
mtk_ut_Callback, NULL);
rilEventAddWakeup (&s_UTlisten_event2);
#endif
#endif
/* atci start */
s_fdATCI_listen= android_get_control_socket(socket_atci);
if (s_fdATCI_listen < 0) {
LOGE("Failed to get socket '%s'", socket_atci);
} else {
ret = listen(s_fdATCI_listen, 4);
if (ret < 0) {
LOGE("Failed to listen on control socket '%d': %s",
s_fdATCI_listen, strerror(errno));
} else {
/* note: non-persistent so we can accept only one connection at a time */
ril_event_set (&s_ATCIlisten_event, s_fdATCI_listen, false,
atci_Callback, NULL);
rilEventAddWakeup (&s_ATCIlisten_event);
}
}
/* atci end */
}
static int
checkAndDequeueRequestInfo(struct RequestInfo *pRI) {
int ret = 0;
/* Hook for current context */
/* pendingRequestsMutextHook refer to &s_pendingRequestsMutex */
pthread_mutex_t * pendingRequestsMutexHook = &s_pendingRequestsMutex;
/* pendingRequestsHook refer to &s_pendingRequests */
RequestInfo ** pendingRequestsHook = &s_pendingRequests;
if (pRI == NULL) {
return 0;
}
#ifdef MTK_GEMINI
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM */
if (RIL_CHANNEL_SET4_OFFSET <= pRI->cid) {
pendingRequestsMutexHook = &s_pendingRequestsMutex4;
pendingRequestsHook = &s_pendingRequests4;
} else if (RIL_CHANNEL_SET3_OFFSET <= pRI->cid) {
pendingRequestsMutexHook = &s_pendingRequestsMutex3;
pendingRequestsHook = &s_pendingRequests3;
} else if (RIL_CHANNEL_OFFSET <= pRI->cid) {
pendingRequestsMutexHook = &s_pendingRequestsMutex2;
pendingRequestsHook = &s_pendingRequests2;
}
#elif (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM */
if (RIL_CHANNEL_SET3_OFFSET <= pRI->cid) {
pendingRequestsMutexHook = &s_pendingRequestsMutex3;
pendingRequestsHook = &s_pendingRequests3;
} else if (RIL_CHANNEL_OFFSET <= pRI->cid) {
pendingRequestsMutexHook = &s_pendingRequestsMutex2;
pendingRequestsHook = &s_pendingRequests2;
}
#else
if (RIL_CHANNEL_OFFSET <= pRI->cid) {
pendingRequestsMutexHook = &s_pendingRequestsMutex2;
pendingRequestsHook = &s_pendingRequests2;
}
#endif
#endif /* MTK_GEMINI */
pthread_mutex_lock(pendingRequestsMutexHook);
for(RequestInfo **ppCur = pendingRequestsHook
; *ppCur != NULL
; ppCur = &((*ppCur)->p_next)
) {
if (pRI == *ppCur) {
ret = 1;
*ppCur = (*ppCur)->p_next;
break;
}
}
pthread_mutex_unlock(pendingRequestsMutexHook);
return ret;
}
extern "C" void
RIL_onRequestComplete(RIL_Token t, RIL_Errno e, void *response, size_t responselen) {
RequestInfo *pRI;
int ret;
size_t errorOffset;
int fd = *s_SocketLinterParam1.s_fdCommand;
RILId id = MTK_RIL_SOCKET_1;
pRI = (RequestInfo *)t;
#ifdef MTK_GEMINI
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
if (RIL_CHANNEL_SET4_OFFSET <= pRI->cid) {
fd = *s_SocketLinterParam4.s_fdCommand;
id = MTK_RIL_SOCKET_4;
} else
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
if (RIL_CHANNEL_SET3_OFFSET <= pRI->cid) {
fd = *s_SocketLinterParam3.s_fdCommand;
id = MTK_RIL_SOCKET_3;
} else
#endif
if (RIL_CHANNEL_OFFSET <= pRI->cid) {
fd = *s_SocketLinterParam2.s_fdCommand;
id = MTK_RIL_SOCKET_2;
}
#endif /* MTK_GEMINI */
if (!checkAndDequeueRequestInfo(pRI)) {
LOGE ("RIL_onRequestComplete RIL%d: invalid RIL_Token", id+1);
return;
}
if (pRI->local > 0) {
// Locally issued command...void only!
// response does not go back up the command socket
LOGD("C[locl]< %s", requestToString(pRI->pCI->requestNumber));
goto done;
}
appendPrintBuf("[%04d]< %s",
pRI->token, requestToString(pRI->pCI->requestNumber));
if(pRI->pCI->requestNumber == RIL_LOCAL_REQUEST_RILD_READ_IMSI){
LOGD("C[locl]< %s done.", requestToString(pRI->pCI->requestNumber));
goto done;
}
#ifdef MTK_EAP_SIM_AKA
/*handle response for local request for response*/
if(pRI->pCI->requestNumber == RIL_LOCAL_REQUEST_SIM_AUTHENTICATION
|| pRI->pCI->requestNumber == RIL_LOCAL_REQUEST_USIM_AUTHENTICATION){
LOGD("[EAP] local request for EAP returned ");
char* strResult = NULL;
char* res = (char*)response;
if(RIL_E_SUCCESS == e){
if(pRI->pCI->requestNumber == RIL_LOCAL_REQUEST_SIM_AUTHENTICATION
&& strlen(res) > 24){
strResult = new char[25];
strResult[0] = '\0';
if(res[0] == '0' && res[1] == '4'){
strncpy(strResult, res+2, 8);
if(res[10] == '0' && res[11] == '8'){
strncpy(strResult+8, res+12, 16);
strResult[24] = '\0';
}else{
LOGE("The length of KC is not valid.");
}
}else{
LOGE("The length of SRES is not valid.");
}
}else{
asprintf(&strResult, "%s",res);
}
}else{
asprintf(&strResult, "ERROR:%s", failCauseToString(e));
}
if(s_fdDebug_command > 0){
LOGD("[EAP] s_fdDebug_command is valid strResult is %s", strResult);
int len = (int)strlen(strResult);
ret = send(s_fdDebug_command, &len, sizeof(int), 0);
if (ret != sizeof(int)) {
LOGD("Socket write Error: when sending arg length");
}else{
ret = send(s_fdDebug_command, strResult, len, 0);
if (ret != len) {
LOGD("[EAP]lose data when send response. ");
}
}
close(s_fdDebug_command);
s_fdDebug_command = -1;
free(strResult);
goto done;
}
}
#endif
/* atci start */
if (s_fdATCI_command > 0 && pRI->pCI->requestNumber == RIL_REQUEST_OEM_HOOK_RAW) {
if (e == RIL_E_SUCCESS) {
int sendLen = 0;
int strLen = 0;
char* data;
data = (char*)malloc(MAX_DATA_SIZE * sizeof(char));
memset(data, 0, MAX_DATA_SIZE);
strLen = responselen / sizeof(char*);
char** p_cur = (char**)response;
char* p = data;
for (int i = 0; i < strLen; i++) {
memcpy(p, p_cur[i], strlen(p_cur[i]));
p = p + strlen(p_cur[i]);
memcpy(p, "\r\n", 2 * sizeof(char));
p = p + 2 * sizeof(char);
}
LOGD("[ATCI] data sent to atci is '%s'", data);
sendLen = send(s_fdATCI_command, data, strlen(data), 0);
if (sendLen != (int) strlen(data)) {
LOGD("[ATCI]lose data when send to atci. errno = %d", errno);
}
free(data);
} else if(pRI->pCI->requestNumber == RIL_REQUEST_OEM_HOOK_RAW) {
char* data = NULL;
int sendLen = 0;
data = (char*)malloc(MAX_DATA_SIZE * sizeof(char));
if(data == NULL) {
LOGE("Can't allocate data buffer");
goto done;
}
memset(data, 0, MAX_DATA_SIZE);
strcpy(data, "ERROR");
sendLen = send(s_fdATCI_command, data, strlen(data), 0);
if (sendLen != (int) strlen(data)) {
LOGD("[ATCI]lose data when send to atci. errno = %d", errno);
}
free(data);
}
goto done;
}
/* atci end */
if (pRI->cancelled == 0) {
Parcel p;
p.writeInt32 (RESPONSE_SOLICITED);
p.writeInt32 (pRI->token);
errorOffset = p.dataPosition();
p.writeInt32 (e);
if ((e == RIL_E_SUCCESS)
|| (e == RIL_E_SIM_PIN2)
|| (e == RIL_E_SIM_PUK2)
|| (e == RIL_E_PASSWORD_INCORRECT)) {
/* process response on success */
/* for PIN related operation we shall take retry count to framework */
ret = pRI->pCI->responseFunction(p, response, responselen);
/* if an error occurred, rewind and mark it */
if (ret != 0) {
p.setDataPosition(errorOffset);
p.writeInt32 (ret);
}
} else {
appendPrintBuf("%s returns %s", printBuf, failCauseToString(e));
}
if (fd < 0) {
LOGD ("RIL onRequestComplete: Command channel closed");
}
LOGI("RIL SOCKET RESPONSE: %s length:%d",requestToString(pRI->pCI->requestNumber),p.dataSize());
sendResponse(p,id);
}
done:
free(pRI);
}
static void
grabPartialWakeLock() {
acquire_wake_lock(PARTIAL_WAKE_LOCK, ANDROID_WAKE_LOCK_NAME);
}
static void
releaseWakeLock() {
release_wake_lock(ANDROID_WAKE_LOCK_NAME);
}
/**
* Timer callback to put us back to sleep before the default timeout
*/
static void
wakeTimeoutCallback (void *param) {
// We're using "param != NULL" as a cancellation mechanism
if (param == NULL) {
//LOGD("wakeTimeout: releasing wake lock");
releaseWakeLock();
} else {
//LOGD("wakeTimeout: releasing wake lock CANCELLED");
}
}
extern "C"
void RIL_onUnsolicitedResponse(int unsolResponse, void *data,
size_t datalen, RILId id)
{
int unsolResponseIndex;
int ret;
int64_t timeReceived = 0;
bool shouldScheduleTimeout = false;
WakeType wakeType = WAKE_PARTIAL;
if (s_registerCalled == 0) {
// Ignore RIL_onUnsolicitedResponse before RIL_register
LOGW("RIL_onUnsolicitedResponse called before RIL_register");
return;
}
unsolResponseIndex = unsolResponse - RIL_UNSOL_RESPONSE_BASE;
if ((unsolResponseIndex < 0)
|| (unsolResponseIndex >= (int32_t)NUM_ELEMS(s_unsolResponses))) {
#ifdef MTK_RIL
if (unsolResponse > (RIL_UNSOL_MTK_BASE + (int32_t)NUM_ELEMS(s_mtk_unsolResponses)))
#endif /* MTK_RIL */
{
LOGE("unsupported unsolicited response code %d", unsolResponse);
return;
}
}
#ifndef REVERSE_MTK_CHANGE
#ifndef MTK_RILD_UT
if( (id == MTK_RIL_SOCKET_1 && *s_SocketLinterParam1.s_fdCommand == *s_SocketLinterParam1.s_fdUT_command)
#ifdef MTK_GEMINI
|| (id == MTK_RIL_SOCKET_2 && *s_SocketLinterParam2.s_fdCommand == *s_SocketLinterParam2.s_fdUT_command)
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
|| (id == MTK_RIL_SOCKET_4 && *s_SocketLinterParam4.s_fdCommand == *s_SocketLinterParam4.s_fdUT_command)
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
|| (id == MTK_RIL_SOCKET_3 && *s_SocketLinterParam3.s_fdCommand == *s_SocketLinterParam3.s_fdUT_command)
#endif
#endif
) {
/* when Carkit or Wimax is connection,
* we should not send the URCs since they didn't handle it
*/
LOGD("Can't send URC during Carkit or Wimax connection for RIL%d, chche:%s",
id+1,
requestToString(unsolResponse));
if (MTK_RIL_SOCKET_1 == id) {
pendedUrcList1 = cacheUrc(pendedUrcList1, unsolResponse, data, datalen , id);
}
#ifdef MTK_GEMINI
else if (MTK_RIL_SOCKET_2 == id) {
pendedUrcList2 = cacheUrc(pendedUrcList2, unsolResponse, data, datalen, id);
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
else if (MTK_RIL_SOCKET_3 == id) {
pendedUrcList3 = cacheUrc(pendedUrcList3, unsolResponse, data, datalen, id);
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 3 SIM*/
else if (MTK_RIL_SOCKET_4 == id) {
pendedUrcList4 = cacheUrc(pendedUrcList4, unsolResponse, data, datalen, id);
}
#endif
#if 0
if(RIL_UNSOL_STK_PROACTIVE_COMMAND == unsolResponse) {
LOGD("RIL_onUnsolicitedResponse store STK proactive command temporarily");
if (id >= MTK_RIL_SOCKET_1 && id < MTK_RIL_SOCKET_NUM) {
s_tempStkPciFlag[id] = 1;
// s_tempStkPci = (char *) data;
asprintf(&s_tempStkPci[id], "%s", (char *) data);
}
}
// To queue phb ready event once the connection is not ready
if (RIL_UNSOL_PHB_READY_NOTIFICATION == unsolResponse) {
LOGD("RIL_onUnsolicitedResponse queue PHB ready event");
if (id < MTK_RIL_SOCKET_NUM) {
s_phbReadyFlag[id] = 1;
}
}
#endif
return;
}
#endif
#endif
//MTK-START [mtk04070][111213][ALPS00093395] ATCI for unsolicited response
char atci_urc_enable[2] = {0};
property_get("persist.service.atci_urc.enable", atci_urc_enable, "0");
if ((s_fdATCI_command > 0) &&
(RIL_UNSOL_ATCI_RESPONSE == unsolResponse) &&
(atoi(atci_urc_enable) == 1))
{
char* responseData = (char*)data;
LOGD("[ATCI] data sent to atci is '%s'", responseData);
unsigned int sendLen = send(s_fdATCI_command, responseData, strlen(responseData), 0);
if (sendLen != (int) strlen(responseData)) {
LOGD("[ATCI]lose data when send to atci.");
}
}
else
{
/* atci start */
if (s_fdCommand == s_fdATCI_command && s_fdATCI_command != -1) {
LOGD("[ATCI]Do not send URC");
return;
}
/* atci end */
}
//MTK-END [mtk04070][111213][ALPS00093395] ATCI for unsolicited response
// Grab a wake lock if needed for this reponse,
// as we exit we'll either release it immediately
// or set a timer to release it later.
#ifdef MTK_RIL
if (unsolResponse >= RIL_UNSOL_MTK_BASE) {
unsolResponseIndex = unsolResponse - RIL_UNSOL_MTK_BASE;
wakeType = s_mtk_unsolResponses[unsolResponseIndex].wakeType;
}
else
#endif /* MTK_RIL */
{
wakeType = s_unsolResponses[unsolResponseIndex].wakeType;
}
switch (wakeType) {
case WAKE_PARTIAL:
grabPartialWakeLock();
shouldScheduleTimeout = true;
break;
case DONT_WAKE:
default:
// No wake lock is grabed so don't set timeout
shouldScheduleTimeout = false;
break;
}
// Mark the time this was received, doing this
// after grabing the wakelock incase getting
// the elapsedRealTime might cause us to goto
// sleep.
if (unsolResponse == RIL_UNSOL_NITZ_TIME_RECEIVED) {
timeReceived = elapsedRealtime();
}
appendPrintBuf("[UNSL]< %s", requestToString(unsolResponse));
Parcel p;
p.writeInt32 (RESPONSE_UNSOLICITED);
p.writeInt32 (unsolResponse);
#ifdef MTK_RIL
if (unsolResponse >= RIL_UNSOL_MTK_BASE) {
ret = s_mtk_unsolResponses[unsolResponseIndex]
.responseFunction(p, data, datalen);
}
else
#endif /* MTK_RIL */
{
ret = s_unsolResponses[unsolResponseIndex]
.responseFunction(p, data, datalen);
}
if (ret != 0) {
// Problem with the response. Don't continue;
goto error_exit;
}
// some things get more payload
switch(unsolResponse) {
case RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED:
#ifdef MTK_RIL
p.writeInt32(s_callbacks.onStateRequest(id, NULL));
appendPrintBuf("%s {%s}", printBuf,
radioStateToString(s_callbacks.onStateRequest(id, NULL)));
#else
p.writeInt32(s_callbacks.onStateRequest());
appendPrintBuf("%s {%s}", printBuf,
radioStateToString(s_callbacks.onStateRequest()));
#endif /* MTK_RIL */
break;
case RIL_UNSOL_NITZ_TIME_RECEIVED:
// Store the time that this was received so the
// handler of this message can account for
// the time it takes to arrive and process. In
// particular the system has been known to sleep
// before this message can be processed.
p.writeInt64(timeReceived);
break;
}
LOGI("%s UNSOLICITED: %s length:%d",rilIdToString(id),requestToString(unsolResponse),p.dataSize());
ret = sendResponse(p,id);
if (ret != 0 && unsolResponse == RIL_UNSOL_NITZ_TIME_RECEIVED) {
// Unfortunately, NITZ time is not poll/update like everything
// else in the system. So, if the upstream client isn't connected,
// keep a copy of the last NITZ response (with receive time noted
// above) around so we can deliver it when it is connected
if (s_lastNITZTimeData != NULL) {
free (s_lastNITZTimeData);
s_lastNITZTimeData = NULL;
}
s_lastNITZTimeData = malloc(p.dataSize());
s_lastNITZTimeDataSize = p.dataSize();
memcpy(s_lastNITZTimeData, p.data(), p.dataSize());
}
// For now, we automatically go back to sleep after TIMEVAL_WAKE_TIMEOUT
// FIXME The java code should handshake here to release wake lock
if (shouldScheduleTimeout) {
// Cancel the previous request
if (s_last_wake_timeout_info != NULL) {
s_last_wake_timeout_info->userParam = (void *)1;
}
s_last_wake_timeout_info
= internalRequestTimedCallback(wakeTimeoutCallback, NULL,
&TIMEVAL_WAKE_TIMEOUT);
}
// Normal exit
return;
error_exit:
// There was an error and we've got the wake lock so release it.
if (shouldScheduleTimeout) {
releaseWakeLock();
}
}
/** FIXME generalize this if you track UserCAllbackInfo, clear it
when the callback occurs
*/
static UserCallbackInfo *
internalRequestTimedCallback (RIL_TimedCallback callback, void *param,
const struct timeval *relativeTime)
{
struct timeval myRelativeTime;
UserCallbackInfo *p_info;
p_info = (UserCallbackInfo *) malloc (sizeof(UserCallbackInfo));
p_info->p_callback = callback;
p_info->userParam = param;
#ifdef MTK_RIL
p_info->cid = (RILChannelId)-1;
#endif
if (relativeTime == NULL) {
/* treat null parameter as a 0 relative time */
memset (&myRelativeTime, 0, sizeof(myRelativeTime));
} else {
/* FIXME I think event_add's tv param is really const anyway */
memcpy (&myRelativeTime, relativeTime, sizeof(myRelativeTime));
}
ril_event_set(&(p_info->event), -1, false, userTimerCallback, p_info);
ril_timer_add(&(p_info->event), &myRelativeTime);
triggerEvLoop();
return p_info;
}
extern "C" void
RIL_requestTimedCallback (RIL_TimedCallback callback, void *param,
const struct timeval *relativeTime) {
internalRequestTimedCallback (callback, param, relativeTime);
}
#ifdef MTK_RIL
static UserCallbackInfo *
internalRequestProxyTimedCallback (RIL_TimedCallback callback, void *param,
const struct timeval *relativeTime,
int proxyId)
{
struct timeval myRelativeTime;
UserCallbackInfo *p_info;
p_info = (UserCallbackInfo *) malloc (sizeof(UserCallbackInfo));
p_info->p_callback = callback;
p_info->userParam = param;
p_info->cid = (RILChannelId)proxyId;
if (relativeTime == NULL) {
/* treat null parameter as a 0 relative time */
memset (&myRelativeTime, 0, sizeof(myRelativeTime));
} else {
/* FIXME I think event_add's tv param is really const anyway */
memcpy (&myRelativeTime, relativeTime, sizeof(myRelativeTime));
}
ril_event_set(&(p_info->event), -1, false, userTimerCallback, p_info);
ril_timer_add(&(p_info->event), &myRelativeTime);
triggerEvLoop();
return p_info;
}
extern "C" void
RIL_requestProxyTimedCallback (RIL_TimedCallback callback, void *param,
const struct timeval *relativeTime,
RILChannelId proxyId) {
internalRequestProxyTimedCallback (callback, param,
relativeTime, proxyId);
}
extern "C" RILChannelId
RIL_queryMyChannelId(RIL_Token t)
{
return ((RequestInfo *) t)->cid;
}
extern "C" int
RIL_queryMyProxyIdByThread()
{
pthread_t selfThread = pthread_self();
pthread_mutex_lock(&s_queryThreadMutex);
int i;
for (i=0; i< RIL_SUPPORT_PROXYS; i++)
{
if (0 != pthread_equal(s_tid_proxy[i], selfThread))
{
pthread_mutex_unlock(&s_queryThreadMutex);
return i;
}
}
pthread_mutex_unlock(&s_queryThreadMutex);
return -1;
}
#endif
const char *
rilIdToString(RILId id)
{
switch(id) {
case MTK_RIL_SOCKET_1:
return "RIL(1)";
#ifdef MTK_GEMINI
case MTK_RIL_SOCKET_2:
return "RIL(2)";
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
case MTK_RIL_SOCKET_4:
return "RIL(4)";
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
case MTK_RIL_SOCKET_3:
return "RIL(3)";
#endif
#endif
default:
return "not a valid RIL";
}
}
const char *
failCauseToString(RIL_Errno e)
{
switch(e) {
case RIL_E_SUCCESS:
return "E_SUCCESS";
case RIL_E_RADIO_NOT_AVAILABLE:
return "E_RAIDO_NOT_AVAILABLE";
case RIL_E_GENERIC_FAILURE:
return "E_GENERIC_FAILURE";
case RIL_E_PASSWORD_INCORRECT:
return "E_PASSWORD_INCORRECT";
case RIL_E_SIM_PIN2:
return "E_SIM_PIN2";
case RIL_E_SIM_PUK2:
return "E_SIM_PUK2";
case RIL_E_REQUEST_NOT_SUPPORTED:
return "E_REQUEST_NOT_SUPPORTED";
case RIL_E_CANCELLED:
return "E_CANCELLED";
case RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL:
return "E_OP_NOT_ALLOWED_DURING_VOICE_CALL";
case RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW:
return "E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW";
case RIL_E_SMS_SEND_FAIL_RETRY:
return "E_SMS_SEND_FAIL_RETRY";
case RIL_E_SIM_ABSENT:
return "E_SIM_ABSENT";
case RIL_E_ILLEGAL_SIM_OR_ME:
return "E_ILLEGAL_SIM_OR_ME";
case RIL_E_BT_SAP_UNDEFINED:
return "RIL_E_BT_SAP_UNDEFINED";
case RIL_E_BT_SAP_NOT_ACCESSIBLE:
return "RIL_E_BT_SAP_NOT_ACCESSIBLE";
case RIL_E_BT_SAP_CARD_REMOVED:
return "RIL_E_BT_SAP_CARD_REMOVED";
#ifdef FEATURE_MULTIMODE_ANDROID
case RIL_E_SUBSCRIPTION_NOT_AVAILABLE:
return "E_SUBSCRIPTION_NOT_AVAILABLE";
case RIL_E_MODE_NOT_SUPPORTED:
return "E_MODE_NOT_SUPPORTED";
#endif
default:
return "<unknown error>";
}
}
const char *
radioStateToString(RIL_RadioState s) {
switch(s) {
case RADIO_STATE_OFF:
return "RADIO_OFF";
case RADIO_STATE_UNAVAILABLE:
return "RADIO_UNAVAILABLE";
case RADIO_STATE_SIM_NOT_READY:
return "RADIO_SIM_NOT_READY";
case RADIO_STATE_SIM_LOCKED_OR_ABSENT:
return "RADIO_SIM_LOCKED_OR_ABSENT";
case RADIO_STATE_SIM_READY:
return "RADIO_SIM_READY";
case RADIO_STATE_RUIM_NOT_READY:
return"RADIO_RUIM_NOT_READY";
case RADIO_STATE_RUIM_READY:
return"RADIO_RUIM_READY";
case RADIO_STATE_RUIM_LOCKED_OR_ABSENT:
return"RADIO_RUIM_LOCKED_OR_ABSENT";
case RADIO_STATE_NV_NOT_READY:
return"RADIO_NV_NOT_READY";
case RADIO_STATE_NV_READY:
return"RADIO_NV_READY";
default:
return "<unknown state>";
}
}
const char *
callStateToString(RIL_CallState s) {
switch(s) {
case RIL_CALL_ACTIVE :
return "ACTIVE";
case RIL_CALL_HOLDING:
return "HOLDING";
case RIL_CALL_DIALING:
return "DIALING";
case RIL_CALL_ALERTING:
return "ALERTING";
case RIL_CALL_INCOMING:
return "INCOMING";
case RIL_CALL_WAITING:
return "WAITING";
default:
return "<unknown state>";
}
}
static AtResponseList* cacheUrc(AtResponseList* pendedUrcList,
int unsolResponse,
void *data,
size_t datalen,
RILId id){
//Only the URC list we wanted.
if (unsolResponse != RIL_UNSOL_STK_PROACTIVE_COMMAND
&& unsolResponse != RIL_UNSOL_CALL_FORWARDING
&& unsolResponse != RIL_UNSOL_SMS_READY_NOTIFICATION
&& unsolResponse != RIL_UNSOL_PHB_READY_NOTIFICATION
&& unsolResponse != RIL_UNSOL_SIM_SMS_STORAGE_FULL
&& unsolResponse != RIL_UNSOL_ME_SMS_STORAGE_FULL) {
return pendedUrcList;
}
AtResponseList* urcCur = pendedUrcList;
AtResponseList* urcPrev = NULL;
int pendedUrcCount = 0;
while (urcCur != NULL) {
LOGD("Pended URC:%d, RILD:%d, :%s",
pendedUrcCount,
id+1,
requestToString(urcCur->id));
urcPrev = urcCur;
urcCur = urcCur->pNext;
pendedUrcCount++;
}
urcCur = (AtResponseList*)malloc(sizeof(AtResponseList));
if (urcPrev != NULL)
urcPrev->pNext = urcCur;
urcCur->pNext = NULL;
urcCur->id = unsolResponse;
urcCur->datalen = datalen;
urcCur->data = (char*)malloc(datalen + 1);
urcCur->data[datalen] = 0x0;
memcpy(urcCur->data, data, datalen);
LOGD("pendedUrcCount = %d", pendedUrcCount + 1);
if (pendedUrcList == NULL)
return urcCur;
return pendedUrcList;
}
static void sendUrc(RILId rid, AtResponseList* urcCached) {
AtResponseList* urc = urcCached;
AtResponseList* urc_temp;
while (urc != NULL) {
LOGD("sendPendedUrcs RIL%d, %s",
rid + 1,
requestToString(urc->id));
RIL_onUnsolicitedResponse ( urc->id, urc->data, urc->datalen, rid);
free(urc->data);
urc_temp = urc;
urc = urc->pNext;
free(urc_temp);
}
}
static void sendPendedUrcs(RILId rid) {
if ((MTK_RIL_SOCKET_1 == rid) && (*s_SocketLinterParam1.s_fdCommand != -1)) {
sendUrc(rid, pendedUrcList1);
pendedUrcList1 = NULL;
}
#ifdef MTK_GEMINI
else if ((MTK_RIL_SOCKET_2 == rid) && (*s_SocketLinterParam2.s_fdCommand != -1)) {
sendUrc(rid, pendedUrcList2);
pendedUrcList2 = NULL;
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
else if ((MTK_RIL_SOCKET_3 == rid) && (*s_SocketLinterParam3.s_fdCommand != -1)) {
sendUrc(rid, pendedUrcList3);
pendedUrcList3 = NULL;
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
else if ((MTK_RIL_SOCKET_4 == rid) && (*s_SocketLinterParam4.s_fdCommand != -1)) {
sendUrc(rid, pendedUrcList4);
pendedUrcList4 = NULL;
}
#endif
}
static void onTempStkPci(RILId rid) {
if ((rid >= MTK_RIL_SOCKET_1 && rid < MTK_RIL_SOCKET_NUM) && s_tempStkPciFlag[rid] != 0) {
LOGD("release temp stk pci string for RIL%d", rid);
s_tempStkPciFlag[rid] = 0;
RIL_onUnsolicitedResponse (
RIL_UNSOL_STK_PROACTIVE_COMMAND,
s_tempStkPci[rid],
strlen(s_tempStkPci[rid]),
rid);
free(s_tempStkPci[rid]);
s_tempStkPci[rid] = NULL;
}
}
#ifndef REVERSE_MTK_CHANGE
#ifndef MTK_RILD_UT
static void storeEcfuUrc(int unsolResponse, RILId id, void *data) {
if (unsolResponse == RIL_UNSOL_CALL_FORWARDING) {
if ((MTK_RIL_SOCKET_1 == id) && (s_fdCommand < 0)) {
if (s_tempEcfuCount_1 < ECFU_COUNT) {
s_tempEcfu_1[s_tempEcfuCount_1][0] = ((int*)data)[0];
s_tempEcfu_1[s_tempEcfuCount_1][1] = ((int*)data)[1];
LOGD("Store Ecfu URC[1][%d] = %d, %d", s_tempEcfuCount_1,
s_tempEcfu_1[s_tempEcfuCount_1][0],
s_tempEcfu_1[s_tempEcfuCount_1][1]);
s_tempEcfuCount_1++;
}
}
#ifdef MTK_GEMINI
else if ((MTK_RIL_SOCKET_2 == id) && (s_fdCommand2 < 0)) {
if (s_tempEcfuCount_2 < ECFU_COUNT) {
s_tempEcfu_2[s_tempEcfuCount_2][0] = ((int*)data)[0];
s_tempEcfu_2[s_tempEcfuCount_2][1] = ((int*)data)[1];
LOGD("Store Ecfu URC[2][%d] = %d, %d", s_tempEcfuCount_2,
s_tempEcfu_2[s_tempEcfuCount_2][0],
s_tempEcfu_2[s_tempEcfuCount_2][1]);
s_tempEcfuCount_2++;
}
}
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
else if ((MTK_RIL_SOCKET_3 == id) && (s_fdCommand3 < 0)) {
if (s_tempEcfuCount_3 < ECFU_COUNT) {
s_tempEcfu_3[s_tempEcfuCount_3][0] = ((int*)data)[0];
s_tempEcfu_3[s_tempEcfuCount_3][1] = ((int*)data)[1];
LOGD("Store Ecfu URC[3][%d] = %d, %d", s_tempEcfuCount_3,
s_tempEcfu_3[s_tempEcfuCount_3][0],
s_tempEcfu_3[s_tempEcfuCount_3][1]);
s_tempEcfuCount_3++;
}
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
else if ((MTK_RIL_SOCKET_4 == id) && (s_fdCommand4 < 0)) {
if (s_tempEcfuCount_4 < ECFU_COUNT) {
s_tempEcfu_4[s_tempEcfuCount_4][0] = ((int*)data)[0];
s_tempEcfu_4[s_tempEcfuCount_4][1] = ((int*)data)[1];
LOGD("Store Ecfu URC[4][%d] = %d, %d", s_tempEcfuCount_4,
s_tempEcfu_4[s_tempEcfuCount_4][0],
s_tempEcfu_4[s_tempEcfuCount_4][1]);
s_tempEcfuCount_4++;
}
}
#endif
#endif
}
}
static void onEcfu(RILId rid) {
int i;
if ((MTK_RIL_SOCKET_1 == rid) && (s_tempEcfuCount_1 > 0)) {
LOGD("Send Ecfu URC[1] to RILJ, count = %d", s_tempEcfuCount_1);
for (i = 0; i < s_tempEcfuCount_1; i++) {
RIL_onUnsolicitedResponse (
RIL_UNSOL_CALL_FORWARDING,
s_tempEcfu_1[i],
2 * sizeof(int *),
rid);
}
s_tempEcfuCount_1 = 0;
}
#ifdef MTK_GEMINI
else if ((MTK_RIL_SOCKET_2 == rid) && (s_tempEcfuCount_2 > 0)) {
LOGD("Send Ecfu URC[2] to RILJ, count = %d", s_tempEcfuCount_2);
for (i = 0; i < s_tempEcfuCount_2; i++) {
RIL_onUnsolicitedResponse (
RIL_UNSOL_CALL_FORWARDING,
s_tempEcfu_2[i],
2 * sizeof(int *),
rid);
}
s_tempEcfuCount_2 = 0;
}
#if (MTK_GEMINI_SIM_NUM >= 3) /* Gemini plus 3 SIM*/
else if ((MTK_RIL_SOCKET_3 == rid) && (s_tempEcfuCount_3 > 0)) {
LOGD("Send Ecfu URC[3] to RILJ, count = %d", s_tempEcfuCount_3);
for (i = 0; i < s_tempEcfuCount_3; i++) {
RIL_onUnsolicitedResponse (
RIL_UNSOL_CALL_FORWARDING,
s_tempEcfu_3[i],
2 * sizeof(int *),
rid);
}
s_tempEcfuCount_3 = 0;
}
#endif
#if (MTK_GEMINI_SIM_NUM >= 4) /* Gemini plus 4 SIM*/
else if ((MTK_RIL_SOCKET_4 == rid) && (s_tempEcfuCount_4 > 0)) {
LOGD("Send Ecfu URC[4] to RILJ, count = %d", s_tempEcfuCount_4);
for (i = 0; i < s_tempEcfuCount_4; i++) {
RIL_onUnsolicitedResponse (
RIL_UNSOL_CALL_FORWARDING,
s_tempEcfu_4[i],
2 * sizeof(int *),
rid);
}
s_tempEcfuCount_4 = 0;
}
#endif
#endif
}
#endif
#endif
} /* namespace android */
const char *
requestToString(int request) {
/*
cat libs/telephony/ril_commands.h \
| egrep "^ *{RIL_" \
| sed -re 's/\{RIL_([^,]+),[^,]+,([^}]+).+/case RIL_\1: return "\1";/'
cat libs/telephony/ril_unsol_commands.h \
| egrep "^ *{RIL_" \
| sed -re 's/\{RIL_([^,]+),([^}]+).+/case RIL_\1: return "\1";/'
*/
switch(request) {
case RIL_REQUEST_GET_SIM_STATUS:
return "GET_SIM_STATUS";
case RIL_REQUEST_ENTER_SIM_PIN:
return "ENTER_SIM_PIN";
case RIL_REQUEST_ENTER_SIM_PUK:
return "ENTER_SIM_PUK";
case RIL_REQUEST_ENTER_SIM_PIN2:
return "ENTER_SIM_PIN2";
case RIL_REQUEST_ENTER_SIM_PUK2:
return "ENTER_SIM_PUK2";
case RIL_REQUEST_CHANGE_SIM_PIN:
return "CHANGE_SIM_PIN";
case RIL_REQUEST_CHANGE_SIM_PIN2:
return "CHANGE_SIM_PIN2";
case RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION:
return "ENTER_NETWORK_DEPERSONALIZATION";
case RIL_REQUEST_GET_CURRENT_CALLS:
return "GET_CURRENT_CALLS";
case RIL_REQUEST_DIAL:
return "DIAL";
case RIL_REQUEST_EMERGENCY_DIAL :
return "EMERGENCY_DIAL";
#ifdef MTK_VT3G324M_SUPPORT
case RIL_REQUEST_VT_DIAL:
return "VT_DIAL";
case RIL_REQUEST_VOICE_ACCEPT:
return "VOICE_ACCEPT";
#endif
case RIL_REQUEST_GET_IMSI:
return "GET_IMSI";
case RIL_REQUEST_HANGUP:
return "HANGUP";
case RIL_REQUEST_HANGUP_ALL:
return "HANGUP_ALL";
case RIL_REQUEST_HANGUP_ALL_EX:
return "HANGUP_ALL_EX";
case RIL_REQUEST_GET_CCM:
return "GET_CCM";
case RIL_REQUEST_GET_ACM:
return "GET_ACM";
case RIL_REQUEST_GET_ACMMAX:
return "GET_ACMMAX";
case RIL_REQUEST_GET_PPU_AND_CURRENCY:
return "GET_PPU_AND_CURRENCY";
case RIL_REQUEST_SET_ACMMAX:
return "SET_ACMMAX";
case RIL_REQUEST_RESET_ACM:
return "RESET_ACM";
case RIL_REQUEST_SET_PPU_AND_CURRENCY:
return "SET_PPU_AND_CURRENCY";
case RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND:
return "HANGUP_WAITING_OR_BACKGROUND";
case RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND:
return "HANGUP_FOREGROUND_RESUME_BACKGROUND";
case RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE:
return "SWITCH_WAITING_OR_HOLDING_AND_ACTIVE";
case RIL_REQUEST_CONFERENCE:
return "CONFERENCE";
case RIL_REQUEST_UDUB:
return "UDUB";
case RIL_REQUEST_LAST_CALL_FAIL_CAUSE:
return "LAST_CALL_FAIL_CAUSE";
case RIL_REQUEST_SIGNAL_STRENGTH:
return "SIGNAL_STRENGTH";
case RIL_REQUEST_VOICE_REGISTRATION_STATE:
return "VOICE_REGISTRATION_STATE";
case RIL_REQUEST_DATA_REGISTRATION_STATE:
return "DATA_REGISTRATION_STATE";
case RIL_REQUEST_OPERATOR:
return "OPERATOR";
case RIL_REQUEST_RADIO_POWER:
return "RADIO_POWER";
case RIL_REQUEST_DTMF:
return "DTMF";
case RIL_REQUEST_SEND_SMS:
return "SEND_SMS";
case RIL_REQUEST_SEND_SMS_EXPECT_MORE:
return "SEND_SMS_EXPECT_MORE";
case RIL_REQUEST_SETUP_DATA_CALL:
return "SETUP_DATA_CALL";
case RIL_REQUEST_SIM_IO:
return "SIM_IO";
case RIL_REQUEST_SEND_USSD:
return "SEND_USSD";
case RIL_REQUEST_CANCEL_USSD:
return "CANCEL_USSD";
case RIL_REQUEST_GET_CLIR:
return "GET_CLIR";
case RIL_REQUEST_SET_CLIR:
return "SET_CLIR";
case RIL_REQUEST_GET_COLP:
return "GET_COLP";
case RIL_REQUEST_SET_COLP:
return "SET_COLP";
case RIL_REQUEST_GET_COLR:
return "GET_COLR";
case RIL_REQUEST_QUERY_CALL_FORWARD_STATUS:
return "QUERY_CALL_FORWARD_STATUS";
case RIL_REQUEST_SET_CALL_FORWARD:
return "SET_CALL_FORWARD";
case RIL_REQUEST_QUERY_CALL_WAITING:
return "QUERY_CALL_WAITING";
case RIL_REQUEST_SET_CALL_WAITING:
return "SET_CALL_WAITING";
case RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION:
return "SET_SUPP_SVC_NOTIFICATION";
case RIL_REQUEST_SMS_ACKNOWLEDGE:
return "SMS_ACKNOWLEDGE";
case RIL_REQUEST_GET_IMEI:
return "GET_IMEI";
case RIL_REQUEST_GET_IMEISV:
return "GET_IMEISV";
case RIL_REQUEST_ANSWER:
return "ANSWER";
case RIL_REQUEST_DEACTIVATE_DATA_CALL:
return "DEACTIVATE_DATA_CALL";
case RIL_REQUEST_QUERY_FACILITY_LOCK:
return "QUERY_FACILITY_LOCK";
case RIL_REQUEST_SET_FACILITY_LOCK:
return "SET_FACILITY_LOCK";
case RIL_REQUEST_CHANGE_BARRING_PASSWORD:
return "CHANGE_BARRING_PASSWORD";
case RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE:
return "QUERY_NETWORK_SELECTION_MODE";
case RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC:
return "SET_NETWORK_SELECTION_AUTOMATIC";
case RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL:
return "SET_NETWORK_SELECTION_MANUAL";
case RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL_WITH_ACT:
return "SET_NETWORK_SELECTION_MANUAL_WIT_ACT";
case RIL_REQUEST_QUERY_AVAILABLE_NETWORKS :
return "QUERY_AVAILABLE_NETWORKS ";
case RIL_REQUEST_DTMF_START:
return "DTMF_START";
case RIL_REQUEST_DTMF_STOP:
return "DTMF_STOP";
case RIL_REQUEST_BASEBAND_VERSION:
return "BASEBAND_VERSION";
case RIL_REQUEST_SEPARATE_CONNECTION:
return "SEPARATE_CONNECTION";
case RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE:
return "SET_PREFERRED_NETWORK_TYPE";
case RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE:
return "GET_PREFERRED_NETWORK_TYPE";
case RIL_REQUEST_GET_NEIGHBORING_CELL_IDS:
return "GET_NEIGHBORING_CELL_IDS";
case RIL_REQUEST_SET_MUTE:
return "SET_MUTE";
case RIL_REQUEST_GET_MUTE:
return "GET_MUTE";
case RIL_REQUEST_QUERY_CLIP:
return "QUERY_CLIP";
case RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE:
return "LAST_DATA_CALL_FAIL_CAUSE";
case RIL_REQUEST_DATA_CALL_LIST:
return "DATA_CALL_LIST";
case RIL_REQUEST_RESET_RADIO:
return "RESET_RADIO";
case RIL_REQUEST_OEM_HOOK_RAW:
return "OEM_HOOK_RAW";
case RIL_REQUEST_OEM_HOOK_STRINGS:
return "OEM_HOOK_STRINGS";
case RIL_REQUEST_SET_BAND_MODE:
return "SET_BAND_MODE";
case RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE:
return "QUERY_AVAILABLE_BAND_MODE";
case RIL_REQUEST_STK_GET_PROFILE:
return "STK_GET_PROFILE";
case RIL_REQUEST_STK_SET_PROFILE:
return "STK_SET_PROFILE";
case RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND:
return "STK_SEND_ENVELOPE_COMMAND";
case RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE:
return "STK_SEND_TERMINAL_RESPONSE";
case RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM:
return "STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM";
case RIL_REQUEST_SCREEN_STATE:
return "SCREEN_STATE";
case RIL_REQUEST_EXPLICIT_CALL_TRANSFER:
return "EXPLICIT_CALL_TRANSFER";
case RIL_REQUEST_SET_LOCATION_UPDATES:
return "SET_LOCATION_UPDATES";
case RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE:
return"CDMA_SET_SUBSCRIPTION_SOURCE";
case RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE:
return"CDMA_SET_ROAMING_PREFERENCE";
case RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE:
return"CDMA_QUERY_ROAMING_PREFERENCE";
case RIL_REQUEST_SET_TTY_MODE:
return"SET_TTY_MODE";
case RIL_REQUEST_QUERY_TTY_MODE:
return"QUERY_TTY_MODE";
case RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE:
return"CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE";
case RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE:
return"CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE";
case RIL_REQUEST_CDMA_FLASH:
return"CDMA_FLASH";
case RIL_REQUEST_CDMA_BURST_DTMF:
return"CDMA_BURST_DTMF";
case RIL_REQUEST_CDMA_SEND_SMS:
return"CDMA_SEND_SMS";
case RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE:
return"CDMA_SMS_ACKNOWLEDGE";
case RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG:
return"GSM_GET_BROADCAST_SMS_CONFIG";
case RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG:
return"GSM_SET_BROADCAST_SMS_CONFIG";
case RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG:
return "CDMA_GET_BROADCAST_SMS_CONFIG";
case RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG:
return "CDMA_SET_BROADCAST_SMS_CONFIG";
case RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION:
return "CDMA_SMS_BROADCAST_ACTIVATION";
case RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY:
return"CDMA_VALIDATE_AND_WRITE_AKEY";
case RIL_REQUEST_CDMA_SUBSCRIPTION:
return"CDMA_SUBSCRIPTION";
case RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM:
return "CDMA_WRITE_SMS_TO_RUIM";
case RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM:
return "CDMA_DELETE_SMS_ON_RUIM";
case RIL_REQUEST_DEVICE_IDENTITY:
return "DEVICE_IDENTITY";
case RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE:
return "EXIT_EMERGENCY_CALLBACK_MODE";
case RIL_REQUEST_GET_SMSC_ADDRESS:
return "GET_SMSC_ADDRESS";
case RIL_REQUEST_SET_SMSC_ADDRESS:
return "SET_SMSC_ADDRESS";
case RIL_REQUEST_REPORT_SMS_MEMORY_STATUS:
return "REPORT_SMS_MEMORY_STATUS";
case RIL_REQUEST_DUAL_SIM_MODE_SWITCH:
return "DUAL_SIM_MODE_SWITCH";
case RIL_REQUEST_RADIO_POWERON:
return "RADIO_POWERON";
case RIL_REQUEST_RADIO_POWEROFF:
return "RADIO_POWEROFF";
case RIL_REQUEST_QUERY_PHB_STORAGE_INFO:
return "QUERY_PHB_STORAGE_INFO";
case RIL_REQUEST_WRITE_PHB_ENTRY:
return "WRITE_PHB_ENTRY";
case RIL_REQUEST_READ_PHB_ENTRY:
return "READ_PHB_ENTRY";
case RIL_REQUEST_SET_GPRS_CONNECT_TYPE:
return "RIL_REQUEST_SET_GPRS_CONNECT_TYPE";
case RIL_REQUEST_SET_GPRS_TRANSFER_TYPE:
return "RIL_REQUEST_SET_GPRS_TRANSFER_TYPE";
case RIL_REQUEST_MOBILEREVISION_AND_IMEI:
return "RIL_REQUEST_MOBILEREVISION_AND_IMEI";//Add by mtk80372 for Barcode Number
case RIL_REQUEST_SET_SCRI:
return "RIL_REQUEST_SET_SCRI";
case RIL_REQUEST_BTSIM_CONNECT:
return "RIL_REQUEST_BTSIM_CONNECT";
case RIL_REQUEST_BTSIM_DISCONNECT_OR_POWEROFF:
return "RIL_REQUEST_BTSIM_DISCONNECT_OR_POWEROFF";
case RIL_REQUEST_BTSIM_POWERON_OR_RESETSIM:
return "RIL_REQUEST_BTSIM_POWERON_OR_RESETSIM";
case RIL_REQUEST_BTSIM_TRANSFERAPDU:
return "RIL_REQUEST_SEND_BTSIM_TRANSFERAPDU";
case RIL_REQUEST_QUERY_ICCID:
return "RIL_REQUEST_QUERY_ICCID";
case RIL_REQUEST_SIM_AUTHENTICATION:
return "RIL_REQUEST_SIM_AUTHENTICATION";
case RIL_REQUEST_USIM_AUTHENTICATION:
return "RIL_REQUEST_USIM_AUTHENTICATION";
case RIL_REQUEST_FORCE_RELEASE_CALL:
return "RIL_REQUEST_FORCE_RELEASE_CALL";
case RIL_REQUEST_SET_CALL_INDICATION:
return "RIL_REQUEST_SET_CALL_INDICATION";
case RIL_REQUEST_REPLACE_VT_CALL:
return "RIL_REQUEST_REPLACE_VT_CALL";
case RIL_REQUEST_GET_3G_CAPABILITY: return "RIL_REQUEST_GET_3G_CAPABILITY";
case RIL_REQUEST_SET_3G_CAPABILITY: return "RIL_REQUEST_SET_3G_CAPABILITY";
case RIL_REQUEST_GET_POL_CAPABILITY:
return "RIL_REQUEST_GET_POL_CAPABILITY";
case RIL_REQUEST_GET_POL_LIST:
return "RIL_REQUEST_GET_POL_LIST";
case RIL_REQUEST_SET_POL_ENTRY:
return "RIL_REQUEST_SET_POL_ENTRY";
case RIL_REQUEST_QUERY_UPB_CAPABILITY:
return "RIL_REQUEST_QUERY_UPB_CAPABILITY";
case RIL_REQUEST_EDIT_UPB_ENTRY:
return "RIL_REQUEST_EDIT_UPB_ENTRY";
case RIL_REQUEST_DELETE_UPB_ENTRY:
return "RIL_REQUEST_DELETE_UPB_ENTRY";
case RIL_REQUEST_READ_UPB_GAS_LIST:
return "RIL_REQUEST_READ_UPB_GAS_LIST";
case RIL_REQUEST_READ_UPB_GRP:
return "RIL_REQUEST_READ_UPB_GRP";
case RIL_REQUEST_WRITE_UPB_GRP:
return "RIL_REQUEST_WRITE_UPB_GRP";
case RIL_REQUEST_DISABLE_VT_CAPABILITY:
return "RIL_REQUEST_DISABLE_VT_CAPABILITY";
case RIL_REQUEST_SET_SIM_RECOVERY_ON:
return "RIL_REQUEST_SET_SIM_RECOVERY_ON";
case RIL_REQUEST_GET_SIM_RECOVERY_ON:
return "RIL_REQUEST_GET_SIM_RECOVERY_ON";
case RIL_REQUEST_SET_TRM:
return "RIL_REQUEST_SET_TRM";
case RIL_REQUEST_VOICE_RADIO_TECH:
return "RIL_REQUEST_VOICE_RADIO_TECH";
case RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED:
return "UNSOL_RESPONSE_RADIO_STATE_CHANGED";
case RIL_REQUEST_GET_SMS_SIM_MEM_STATUS:
return "RIL_REQUEST_GET_SMS_SIM_MEM_STATUS";
case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED:
return "UNSOL_RESPONSE_CALL_STATE_CHANGED";
case RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED:
return "UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED";
case RIL_UNSOL_RESPONSE_NEW_SMS:
return "UNSOL_RESPONSE_NEW_SMS";
case RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT:
return "UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT";
case RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM:
return "UNSOL_RESPONSE_NEW_SMS_ON_SIM";
case RIL_UNSOL_ON_USSD:
return "UNSOL_ON_USSD";
case RIL_UNSOL_ON_USSD_REQUEST:
return "UNSOL_ON_USSD_REQUEST(obsolete)";
case RIL_UNSOL_NITZ_TIME_RECEIVED:
return "UNSOL_NITZ_TIME_RECEIVED";
case RIL_UNSOL_SIGNAL_STRENGTH:
return "UNSOL_SIGNAL_STRENGTH";
case RIL_UNSOL_STK_SESSION_END:
return "UNSOL_STK_SESSION_END";
case RIL_UNSOL_STK_PROACTIVE_COMMAND:
return "UNSOL_STK_PROACTIVE_COMMAND";
case RIL_UNSOL_STK_EVENT_NOTIFY:
return "UNSOL_STK_EVENT_NOTIFY";
case RIL_UNSOL_STK_CALL_SETUP:
return "UNSOL_STK_CALL_SETUP";
case RIL_UNSOL_SIM_SMS_STORAGE_FULL:
return "UNSOL_SIM_SMS_STORAGE_FUL";
case RIL_UNSOL_SIM_REFRESH:
return "UNSOL_SIM_REFRESH";
case RIL_UNSOL_DATA_CALL_LIST_CHANGED:
return "UNSOL_DATA_CALL_LIST_CHANGED";
case RIL_UNSOL_CALL_RING:
return "UNSOL_CALL_RING";
case RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED:
return "UNSOL_RESPONSE_SIM_STATUS_CHANGED";
case RIL_UNSOL_RESPONSE_CDMA_NEW_SMS:
return "UNSOL_NEW_CDMA_SMS";
case RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS:
return "UNSOL_NEW_BROADCAST_SMS";
case RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL:
return "UNSOL_CDMA_RUIM_SMS_STORAGE_FULL";
case RIL_UNSOL_RESTRICTED_STATE_CHANGED:
return "UNSOL_RESTRICTED_STATE_CHANGED";
case RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE:
return "UNSOL_ENTER_EMERGENCY_CALLBACK_MODE";
case RIL_UNSOL_CDMA_CALL_WAITING:
return "UNSOL_CDMA_CALL_WAITING";
case RIL_UNSOL_CDMA_OTA_PROVISION_STATUS:
return "UNSOL_CDMA_OTA_PROVISION_STATUS";
case RIL_UNSOL_CDMA_INFO_REC:
return "UNSOL_CDMA_INFO_REC";
case RIL_UNSOL_OEM_HOOK_RAW:
return "UNSOL_OEM_HOOK_RAW";
case RIL_UNSOL_RINGBACK_TONE:
return "UNSOL_RINGBACK_TONE";
case RIL_UNSOL_RESEND_INCALL_MUTE:
return "UNSOL_RESEND_INCALL_MUTE";
/* MTK Proprietary URC */
case RIL_UNSOL_NEIGHBORING_CELL_INFO:
return "UNSOL_NEIGHBORING_CELL_INFO";
case RIL_UNSOL_NETWORK_INFO:
return "UNSOL_NETWORK_INFO";
case RIL_UNSOL_CALL_FORWARDING:
return "UNSOL_CALL_FORWARDING";
case RIL_UNSOL_CRSS_NOTIFICATION:
return "UNSOL_CRSS_NOTIFICATION";
case RIL_UNSOL_CALL_PROGRESS_INFO:
return "UNSOL_CALL_PROGRESS_INFO";
case RIL_UNSOL_PHB_READY_NOTIFICATION:
return "RIL_UNSOL_PHB_READY_NOTIFICATION";
case RIL_UNSOL_SIM_INSERTED_STATUS:
return "UNSOL_SIM_INSERTED_STATUS";
case RIL_UNSOL_SIM_MISSING:
return "UNSOL_SIM_MISSING";
case RIL_UNSOL_SIM_RECOVERY:
return "RIL_UNSOL_SIM_RECOVERY";
case RIL_UNSOL_VIRTUAL_SIM_ON:
return "RIL_UNSOL_VIRTUAL_SIM_ON";
case RIL_UNSOL_VIRTUAL_SIM_OFF:
return "RIL_UNSOL_VIRTUAL_SIM_OFF";
case RIL_UNSOL_SPEECH_INFO:
return "UNSOL_SPEECH_INFO";
case RIL_UNSOL_RADIO_TEMPORARILY_UNAVAILABLE:
return "UNSOL_RADIO_TEMPORARILY_UNAVAILABLE";
case RIL_UNSOL_ME_SMS_STORAGE_FULL:
return "RIL_UNSOL_ME_SMS_STORAGE_FULL";
case RIL_UNSOL_SMS_READY_NOTIFICATION:
return "RIL_UNSOL_SMS_READY_NOTIFICATION";
#ifdef MTK_VT3G324M_SUPPORT
case RIL_UNSOL_VT_STATUS_INFO:
return "UNSOL_VT_STATUS_INFO";
case RIL_UNSOL_VT_RING_INFO:
return "UNSOL_VT_RING_INFO";
#endif
case RIL_UNSOL_INCOMING_CALL_INDICATION:
return "UNSOL_INCOMING_CALL_INDICATION";
case RIL_UNSOL_SCRI_RESULT:
return "UNSOL_SCRI_RESULT";
case RIL_UNSOL_GPRS_DETACH:
return "RIL_UNSOL_GPRS_DETACH";
case RIL_REQUEST_DELETE_SMS_ON_SIM:
return "RIL_REQUEST_DELETE_SMS_ON_SIM";
case RIL_LOCAL_REQUEST_SIM_AUTHENTICATION:
return "RIL_LOCAL_REQUEST_SIM_AUTHENTICATION";
case RIL_LOCAL_REQUEST_USIM_AUTHENTICATION:
return "RIL_LOCAL_REQUEST_USIM_AUTHENTICATION";
case RIL_UNSOL_IMEI_LOCK:
return "RIL_UNSOL_IMEI_LOCK";
case RIL_UNSOL_RESPONSE_PS_NETWORK_STATE_CHANGED:
return "RIL_UNSOL_RESPONSE_PS_NETWORK_STATE_CHANGED";
case RIL_UNSOL_RESPONSE_MMRR_STATUS_CHANGED:
return "RIL_UNSOL_RESPONSE_MMRR_STATUS_CHANGED";
case RIL_REQUEST_DETECT_SIM_MISSING:
return "RIL_REQUEST_DETECT_SIM_MISSING";
//MTK-START [mtk80950][120410][ALPS00266631xxxxxxxx]check whether download calibration data or not
case RIL_REQUEST_GET_CALIBRATION_DATA:
return "RIL_REQUEST_GET_CALIBRATION_DATA";
//MTK-END [mtk80950][120410][ALPS00266631]check whether download calibration data or not
case RIL_REQUEST_GET_PHB_STRING_LENGTH:
return "RIL_REQUEST_GET_PHB_STRING_LENGTH";
case RIL_REQUEST_GET_PHB_MEM_STORAGE:
return "RIL_REQUEST_GET_PHB_MEM_STORAGE";
case RIL_REQUEST_SET_PHB_MEM_STORAGE:
return "RIL_REQUEST_SET_PHB_MEM_STORAGE";
case RIL_REQUEST_READ_PHB_ENTRY_EXT:
return "RIL_REQUEST_READ_PHB_ENTRY_EXT";
case RIL_REQUEST_WRITE_PHB_ENTRY_EXT:
return "RIL_REQUEST_WRITE_PHB_ENTRY_EXT";
case RIL_UNSOL_RESPONSE_ACMT:
return "RIL_UNSOL_RESPONSE_ACMT";
case RIL_UNSOL_EF_CSP_PLMN_MODE_BIT:
return "RIL_UNSOL_EF_CSP_PLMN_MODE_BIT";
case RIL_REQUEST_GET_SMS_PARAMETERS:
return "RIL_REQUEST_GET_SMS_PARAMETERS";
case RIL_REQUEST_SET_SMS_PARAMETERS:
return "RIL_REQUEST_SET_SMS_PARAMETERS";
case RIL_REQUEST_WRITE_SMS_TO_SIM:
return "RIL_REQUEST_WRITE_SMS_TO_SIM";
// NFC SEEK start
case RIL_REQUEST_SIM_TRANSMIT_BASIC:
return "SIM_TRANSMIT_BASIC";
case RIL_REQUEST_SIM_OPEN_CHANNEL:
return "SIM_OPEN_CHANNEL";
case RIL_REQUEST_SIM_CLOSE_CHANNEL:
return "SIM_CLOSE_CHANNEL";
case RIL_REQUEST_SIM_TRANSMIT_CHANNEL:
return "SIM_TRANSMIT_CHANNEL";
case RIL_REQUEST_SIM_GET_ATR:
return "SIM_GET_ATR";
case RIL_REQUEST_SIM_OPEN_CHANNEL_WITH_SW:
return "SIM_OPEN_CHANNEL_WITH_SW";
// NFC SEEK end
case RIL_UNSOL_SIM_PLUG_OUT:
return "RIL_UNSOL_SIM_PLUG_OUT";
case RIL_UNSOL_SIM_PLUG_IN:
return "RIL_UNSOL_SIM_PLUG_IN";
case RIL_REQUEST_SET_ETWS:
return "SET_ETWS";
case RIL_REQUEST_SET_CB_CHANNEL_CONFIG_INFO:
return "RIL_REQUEST_SET_CB_CHANNEL_CONFIG_INFO";
case RIL_REQUEST_SET_CB_LANGUAGE_CONFIG_INFO:
return "RIL_REQUEST_SET_CB_LANGUAGE_CONFIG_INFO";
case RIL_REQUEST_GET_CB_CONFIG_INFO:
return "RIL_REQUEST_GET_CB_CONFIG_INFO";
case RIL_REQUEST_SET_ALL_CB_LANGUAGE_ON:
return "RIL_REQUEST_SET_ALL_CB_LANGUAGE_ON";
//[New R8 modem FD]
case RIL_REQUEST_SET_FD_MODE:
return "SET_FD_MODE";
case RIL_LOCAL_REQUEST_RILD_READ_IMSI:
return "RIL_LOCAL_REQUEST_RILD_READ_IMSI";
case RIL_UNSOL_CNAP:
return "RIL_UNSOL_CNAP";
default:
return "<unknown request>";
}
}
const char *
rilIdToString(RILId id)
{
switch(id) {
case MTK_RIL_SOCKET_1:
return "RIL(1)";
#ifdef MTK_GEMINI
case MTK_RIL_SOCKET_2:
return "RIL(2)";
#if (MTK_GEMINI_SIM_NUM >= 4)
case MTK_RIL_SOCKET_4:
return "RIL(4)";
#endif
#if (MTK_GEMINI_SIM_NUM >= 3)
case MTK_RIL_SOCKET_3:
return "RIL(3)";
#endif
#endif
default:
return "not a valid RIL";
}
}
const char *
failCauseToString(RIL_Errno e)
{
switch(e) {
case RIL_E_SUCCESS:
return "E_SUCCESS";
case RIL_E_RADIO_NOT_AVAILABLE:
return "E_RAIDO_NOT_AVAILABLE";
case RIL_E_GENERIC_FAILURE:
return "E_GENERIC_FAILURE";
case RIL_E_PASSWORD_INCORRECT:
return "E_PASSWORD_INCORRECT";
case RIL_E_SIM_PIN2:
return "E_SIM_PIN2";
case RIL_E_SIM_PUK2:
return "E_SIM_PUK2";
case RIL_E_REQUEST_NOT_SUPPORTED:
return "E_REQUEST_NOT_SUPPORTED";
case RIL_E_CANCELLED:
return "E_CANCELLED";
case RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL:
return "E_OP_NOT_ALLOWED_DURING_VOICE_CALL";
case RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW:
return "E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW";
case RIL_E_SMS_SEND_FAIL_RETRY:
return "E_SMS_SEND_FAIL_RETRY";
case RIL_E_SIM_ABSENT:
return "E_SIM_ABSENT";
case RIL_E_ILLEGAL_SIM_OR_ME:
return "E_ILLEGAL_SIM_OR_ME";
case RIL_E_BT_SAP_UNDEFINED:
return "RIL_E_BT_SAP_UNDEFINED";
case RIL_E_BT_SAP_NOT_ACCESSIBLE:
return "RIL_E_BT_SAP_NOT_ACCESSIBLE";
case RIL_E_BT_SAP_CARD_REMOVED:
return "RIL_E_BT_SAP_CARD_REMOVED";
#ifdef FEATURE_MULTIMODE_ANDROID
case RIL_E_SUBSCRIPTION_NOT_AVAILABLE:
return "E_SUBSCRIPTION_NOT_AVAILABLE";
case RIL_E_MODE_NOT_SUPPORTED:
return "E_MODE_NOT_SUPPORTED";
#endif
default:
return "<unknown error>";
}
}
const char *
radioStateToString(RIL_RadioState s) {
switch(s) {
case RADIO_STATE_OFF:
return "RADIO_OFF";
case RADIO_STATE_UNAVAILABLE:
return "RADIO_UNAVAILABLE";
case RADIO_STATE_SIM_NOT_READY:
return "RADIO_SIM_NOT_READY";
case RADIO_STATE_SIM_LOCKED_OR_ABSENT:
return "RADIO_SIM_LOCKED_OR_ABSENT";
case RADIO_STATE_SIM_READY:
return "RADIO_SIM_READY";
case RADIO_STATE_RUIM_NOT_READY:
return"RADIO_RUIM_NOT_READY";
case RADIO_STATE_RUIM_READY:
return"RADIO_RUIM_READY";
case RADIO_STATE_RUIM_LOCKED_OR_ABSENT:
return"RADIO_RUIM_LOCKED_OR_ABSENT";
case RADIO_STATE_NV_NOT_READY:
return"RADIO_NV_NOT_READY";
case RADIO_STATE_NV_READY:
return"RADIO_NV_READY";
default:
return "<unknown state>";
}
}
const char *
callStateToString(RIL_CallState s) {
switch(s) {
case RIL_CALL_ACTIVE :
return "ACTIVE";
case RIL_CALL_HOLDING:
return "HOLDING";
case RIL_CALL_DIALING:
return "DIALING";
case RIL_CALL_ALERTING:
return "ALERTING";
case RIL_CALL_INCOMING:
return "INCOMING";
case RIL_CALL_WAITING:
return "WAITING";
default:
return "<unknown state>";
}
}
/*********************************
[Telephony Mode Definition]
0: default, not MT6589
1: W+G Gemini
2: T+G Gemini
3: FDD Single SIM
4: TDD Single SIM
5: W+T DualTalk
6: T+G DualTalk
7: W+G DualTalk
8: G+G DualTalk
*********************************/
int getTelephonyMode() {
int telephonyMode = MTK_TELEPHONY_MODE;
if (telephonyMode < 0) {
telephonyMode = 0;
}
return telephonyMode;
}
int isDualTalkMode()
{
int telephonyMode = getTelephonyMode();
if (telephonyMode == 0) {
char property_value1[30] = { 0 };
char property_value2[30] = { 0 };
property_get("rild3.libpath", property_value1, "");
property_get("rild3.libargs", property_value2, "");
return (strlen(property_value1) > 0) && (strlen(property_value2) > 0);
} else if (telephonyMode >= 5) {
return 1;
} else {
return 0;
}
}
int isGeminiMode()
{
int telephonyMode = getTelephonyMode();
char property_value[5] = { 0 };
int current_share_modem = 0;
if (telephonyMode == 0)
{
current_share_modem = MTK_SHARE_MODEM_CURRENT;
switch (current_share_modem) {
case 1:
return 0;
case 2:
return 1;
}
}
else if (telephonyMode < 3) {
LOGD("isGeminiMode 1");
return 1;
}
return 0;
}
int isSingleMode()
{
int telephonyMode = getTelephonyMode();
char property_value[5] = { 0 };
int current_share_modem = 0;
if (telephonyMode == 0) {
current_share_modem = MTK_SHARE_MODEM_CURRENT;
switch (current_share_modem) {
case 1:
return 1;
case 2:
return 0;
}
} else if (telephonyMode == 3 || telephonyMode == 4) {
return 1;
}
return 0;
}
|
aff9564f03da307ac064b29c7fb38276260bc6b6 | 71b464bf9442c733ad6d8c8c59a7f6d08a2ad0e8 | /Compiler/CLFile.h | e7ff010c4478eb6cc1aca5f0ff6175d34a66b32e | [] | no_license | colll78/Cminusminus | b4b868dffa34c85cb6e799a710f8512d5a8ba8e5 | 67506718a5d0654bd067a38bcc49b3221d8ec177 | refs/heads/master | 2022-03-18T07:38:58.277274 | 2022-02-19T20:58:54 | 2022-02-19T20:58:54 | 238,611,597 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 876 | h | CLFile.h | #pragma once
#include "CLMemberInfo.h"
#include "CLConstantPool.h"
class CLFile {
public:
CLFile();
long long magic; // 0xCAFEBABE
int minor_version;
int major_version;
int constant_pool_count;
CLConstantPool constant_pool;
int access_flags;
int this_class;
int super_class;
int interfaces_count;
std::vector<int> interfaces;
int fields_count;
std::vector<CLFieldInfo> fields;
int methods_count;
std::vector<CLMethodInfo> methods;
int attributes_count;
std::vector<std::unique_ptr<CLAttributeInfo>> *attributes;
void write(CLOutputStream& out);
std::string class_access_flags_to_string(int access_flags);
std::string inner_class_access_flags_to_string(int access_flags);
std::string field_access_flags_to_string(int access_flags);
std::string method_access_flags_to_string(int access_flags);
static int access_flag_to_int(std::string access_flags);
}; |
b264f15776f8387649276d234e22f19fb51cc39e | cfeac52f970e8901871bd02d9acb7de66b9fb6b4 | /generated/src/aws-cpp-sdk-panorama/include/aws/panorama/model/EthernetStatus.h | 64aada5e5711f8a12f29ff84f3b55ebae561caef | [
"Apache-2.0",
"MIT",
"JSON"
] | permissive | aws/aws-sdk-cpp | aff116ddf9ca2b41e45c47dba1c2b7754935c585 | 9a7606a6c98e13c759032c2e920c7c64a6a35264 | refs/heads/main | 2023-08-25T11:16:55.982089 | 2023-08-24T18:14:53 | 2023-08-24T18:14:53 | 35,440,404 | 1,681 | 1,133 | Apache-2.0 | 2023-09-12T15:59:33 | 2015-05-11T17:57:32 | null | UTF-8 | C++ | false | false | 4,967 | h | EthernetStatus.h | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/panorama/Panorama_EXPORTS.h>
#include <aws/panorama/model/NetworkConnectionStatus.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace Panorama
{
namespace Model
{
/**
* <p>A device's Ethernet status.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/panorama-2019-07-24/EthernetStatus">AWS
* API Reference</a></p>
*/
class EthernetStatus
{
public:
AWS_PANORAMA_API EthernetStatus();
AWS_PANORAMA_API EthernetStatus(Aws::Utils::Json::JsonView jsonValue);
AWS_PANORAMA_API EthernetStatus& operator=(Aws::Utils::Json::JsonView jsonValue);
AWS_PANORAMA_API Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The device's connection status.</p>
*/
inline const NetworkConnectionStatus& GetConnectionStatus() const{ return m_connectionStatus; }
/**
* <p>The device's connection status.</p>
*/
inline bool ConnectionStatusHasBeenSet() const { return m_connectionStatusHasBeenSet; }
/**
* <p>The device's connection status.</p>
*/
inline void SetConnectionStatus(const NetworkConnectionStatus& value) { m_connectionStatusHasBeenSet = true; m_connectionStatus = value; }
/**
* <p>The device's connection status.</p>
*/
inline void SetConnectionStatus(NetworkConnectionStatus&& value) { m_connectionStatusHasBeenSet = true; m_connectionStatus = std::move(value); }
/**
* <p>The device's connection status.</p>
*/
inline EthernetStatus& WithConnectionStatus(const NetworkConnectionStatus& value) { SetConnectionStatus(value); return *this;}
/**
* <p>The device's connection status.</p>
*/
inline EthernetStatus& WithConnectionStatus(NetworkConnectionStatus&& value) { SetConnectionStatus(std::move(value)); return *this;}
/**
* <p>The device's physical address.</p>
*/
inline const Aws::String& GetHwAddress() const{ return m_hwAddress; }
/**
* <p>The device's physical address.</p>
*/
inline bool HwAddressHasBeenSet() const { return m_hwAddressHasBeenSet; }
/**
* <p>The device's physical address.</p>
*/
inline void SetHwAddress(const Aws::String& value) { m_hwAddressHasBeenSet = true; m_hwAddress = value; }
/**
* <p>The device's physical address.</p>
*/
inline void SetHwAddress(Aws::String&& value) { m_hwAddressHasBeenSet = true; m_hwAddress = std::move(value); }
/**
* <p>The device's physical address.</p>
*/
inline void SetHwAddress(const char* value) { m_hwAddressHasBeenSet = true; m_hwAddress.assign(value); }
/**
* <p>The device's physical address.</p>
*/
inline EthernetStatus& WithHwAddress(const Aws::String& value) { SetHwAddress(value); return *this;}
/**
* <p>The device's physical address.</p>
*/
inline EthernetStatus& WithHwAddress(Aws::String&& value) { SetHwAddress(std::move(value)); return *this;}
/**
* <p>The device's physical address.</p>
*/
inline EthernetStatus& WithHwAddress(const char* value) { SetHwAddress(value); return *this;}
/**
* <p>The device's IP address.</p>
*/
inline const Aws::String& GetIpAddress() const{ return m_ipAddress; }
/**
* <p>The device's IP address.</p>
*/
inline bool IpAddressHasBeenSet() const { return m_ipAddressHasBeenSet; }
/**
* <p>The device's IP address.</p>
*/
inline void SetIpAddress(const Aws::String& value) { m_ipAddressHasBeenSet = true; m_ipAddress = value; }
/**
* <p>The device's IP address.</p>
*/
inline void SetIpAddress(Aws::String&& value) { m_ipAddressHasBeenSet = true; m_ipAddress = std::move(value); }
/**
* <p>The device's IP address.</p>
*/
inline void SetIpAddress(const char* value) { m_ipAddressHasBeenSet = true; m_ipAddress.assign(value); }
/**
* <p>The device's IP address.</p>
*/
inline EthernetStatus& WithIpAddress(const Aws::String& value) { SetIpAddress(value); return *this;}
/**
* <p>The device's IP address.</p>
*/
inline EthernetStatus& WithIpAddress(Aws::String&& value) { SetIpAddress(std::move(value)); return *this;}
/**
* <p>The device's IP address.</p>
*/
inline EthernetStatus& WithIpAddress(const char* value) { SetIpAddress(value); return *this;}
private:
NetworkConnectionStatus m_connectionStatus;
bool m_connectionStatusHasBeenSet = false;
Aws::String m_hwAddress;
bool m_hwAddressHasBeenSet = false;
Aws::String m_ipAddress;
bool m_ipAddressHasBeenSet = false;
};
} // namespace Model
} // namespace Panorama
} // namespace Aws
|
42eb9830dcf3cba2891471fba05bc32d3eab09c1 | 577d4a9814d5343a63f9aa751ed14197c78f2dec | /divideTwoIntegers29/div.cpp | 52bdfe60a376e39add681e2687ab444cddfc8f43 | [] | no_license | xiaoxiaojiangshang/LeetCode | 20d6ead4dc5332e0c682d6701cdbee6c70722671 | 4a7f24a6fbba9b8bdb2bcdc8c416d39fb60970c5 | refs/heads/master | 2022-04-29T20:09:47.908930 | 2022-04-10T17:20:36 | 2022-04-10T17:20:36 | 133,293,047 | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 797 | cpp | div.cpp | /*
Author: jgz
Date: 2018/7/11 10:44:06
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#define MAXN 10000
int divide(int dividend, int divisor) {
long long a=dividend;
long long b=divisor;
bool flag=(a*b>=0?true:false);
if(b<0) b= -b;
if(a<0) a= -a;
int inc = b;
long long count=1;
while(a>b) {
b = b<<1;
count =count +count ;
}
int ret = count;
long long i;
for(i=count; i>count/2&&a<b; i--) {
b -= inc;
}
if(divisor==-1&&-i==INT_MIN)
return INT_MAX;
return (flag>0?i:-i);
}
int main() {
const char *fname="dataIn.txt";
FILE *fp;
int a,b;
if((fp=fopen(fname,"r"))==NULL) {
printf("´ò¿ªÎļþ%s´íÎó\n",fname);
return NULL;
}
while(fscanf(fp,"%d %d",&a,&b)==2) {
printf("%d\n",divide(a,b));
}
return 0;
}
|
e00130b450de3a1eeab021bbd29891bc0f92ab23 | 797e4e68931d4e012791f7998135945dcb0ca02c | /src/logging/SourceLocation.cpp | 38cd3be1b89be9dcc3b713c389da25228a27ca1f | [] | no_license | fast-project/lama | c6aae60a8736bf6f4c2ec33297ba94a9d2344a80 | f3951adaf4f414ebc5076360e003a36f534862ab | refs/heads/master | 2021-01-18T18:16:31.551069 | 2013-10-31T10:58:22 | 2013-10-31T10:58:22 | 38,698,153 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,922 | cpp | SourceLocation.cpp | /**
* @file SourceLocation.cpp
*
* @license
* Copyright (c) 2009-2013
* Fraunhofer Institute for Algorithms and Scientific Computing SCAI
* for Fraunhofer-Gesellschaft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* @endlicense
*
* @brief SourceLocation.cpp
* @author Thomas Brandes
* @date 01.03.2011
* @since 1.0.0
*/
// hpp
#include <logging/SourceLocation.hpp>
#include <string.h>
namespace log4lama
{
SourceLocation::SourceLocation( const char* const filename, const char* const funcname, const int line )
: mFileName( filename ), mFuncName( funcname ), mLine( line )
{
const char* shortname = strrchr( filename, '/' );
if ( shortname )
{
mFileName = shortname + 1;
}
}
std::ostream& operator<<( std::ostream& os, const SourceLocation& loc )
{
os << loc.mFileName << "::" << loc.mLine << ", funct=" << loc.mFuncName;
return os;
}
}
|
f3a4bf7f966aabbd85ed81b2e01bba71a8272967 | 418211f8b27352110acd9cd4ef86219af9667740 | /expression-tree/composites/Composite_Add_Node.h | 2a91a0d7617c3acfcb9ffdf48bff2d19f5364ef8 | [] | no_license | douglascraigschmidt/CPlusPlus | 4592f09dc6a57a3b00a01fa7d25e02c31105877a | 4b67965f3a41bd99fbad8e8405be3d998fbbe1a2 | refs/heads/master | 2022-08-28T01:28:58.719964 | 2022-07-21T11:50:49 | 2022-07-21T11:50:49 | 251,707,132 | 130 | 81 | null | 2021-05-26T14:35:00 | 2020-03-31T19:16:16 | C++ | UTF-8 | C++ | false | false | 760 | h | Composite_Add_Node.h | /* -*- C++ -*- */
#ifndef _COMPOSITE_ADD_NODE_H
#define _COMPOSITE_ADD_NODE_H
#include "Composite_Binary_Node.h"
// Forward declaration.
class Component_Node;
class Visitor;
/**
* @class Composite_Add_Node
*
* @brief A composite node containing left and right children. The
* meaning of this node is left + right.
*/
class Composite_Add_Node : public Composite_Binary_Node {
public:
/// Ctor
Composite_Add_Node (Component_Node *left,
Component_Node *right);
/// Return the printable character stored in the node.
[[nodiscard]] int item () const override;
/// Define the @a accept() operation used for the Visitor pattern.
void accept (Visitor &visitor) const override;
};
#endif /* _COMPOSITE_ADD_NODE_H */
|
d399215594fc56063b694eb58d0e0cd61c3647a3 | 8a87f5b889a9ce7d81421515f06d9c9cbf6ce64a | /3rdParty/boost/1.78.0/libs/geometry/doc/index/src/examples/rtree/interprocess.cpp | 61d3f0b50548c808ea5d8ad0d7f65bbd70ee989b | [
"BSL-1.0",
"Apache-2.0",
"BSD-3-Clause",
"ICU",
"Zlib",
"GPL-1.0-or-later",
"OpenSSL",
"ISC",
"LicenseRef-scancode-gutenberg-2020",
"MIT",
"GPL-2.0-only",
"CC0-1.0",
"LicenseRef-scancode-autoconf-simple-exception",
"LicenseRef-scancode-pcre",
"Bison-exception-2.2",
"LicenseRef-scancode... | permissive | arangodb/arangodb | 0980625e76c56a2449d90dcb8d8f2c485e28a83b | 43c40535cee37fc7349a21793dc33b1833735af5 | refs/heads/devel | 2023-08-31T09:34:47.451950 | 2023-08-31T07:25:02 | 2023-08-31T07:25:02 | 2,649,214 | 13,385 | 982 | Apache-2.0 | 2023-09-14T17:02:16 | 2011-10-26T06:42:00 | C++ | UTF-8 | C++ | false | false | 3,493 | cpp | interprocess.cpp | // Boost.Geometry Index
//
// Quickbook Examples
//
// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
//
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//[rtree_interprocess
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <boost/foreach.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <vector>
#include <string>
#include <cstdlib> //std::system
//For parent process argc == 1, for child process argc > 1
int main(int argc, char *argv[])
{
using namespace boost::interprocess;
namespace bg = boost::geometry;
namespace bgm = bg::model;
namespace bgi = bg::index;
typedef bgm::point<float, 2, bg::cs::cartesian> P;
typedef bgm::box<P> B;
typedef bgi::linear<32, 8> Par;
typedef bgi::indexable<B> I;
typedef bgi::equal_to<B> E;
typedef allocator<B, managed_shared_memory::segment_manager> Alloc;
typedef bgi::rtree<B, Par, I, E, Alloc> Rtree;
//Parent process
if ( argc == 1 )
{
struct shm_remove
{
shm_remove() { shared_memory_object::remove("MySharedMemory"); }
~shm_remove(){ shared_memory_object::remove("MySharedMemory"); }
} remover;
managed_shared_memory segment(create_only, "MySharedMemory", 65536);
std::cout << "Parent: Constructing container\n";
Rtree * tree = segment.construct<Rtree>("Rtree")(Par(), I(), E(), Alloc(segment.get_segment_manager()));
std::cout << "Parent: Filling container with 100 boxes\n";
for ( float i = 0 ; i < 100 ; i += 1 )
tree->insert(B(P(i, i), P(i+0.5f, i+0.5f)));
std::cout << "Parent: Tree content\n";
Rtree::bounds_type bb = tree->bounds();
std::cout << "[(" << bg::get<0>(bb.min_corner()) << ", " << bg::get<1>(bb.min_corner())
<< ")(" << bg::get<0>(bb.max_corner()) << ", " << bg::get<1>(bb.max_corner()) << ")]\n";
std::cout << "Parent: Running child process\n";
std::string s(argv[0]); s += " child ";
if ( 0 != std::system(s.c_str()) )
return 1;
if ( segment.find<Rtree>("Rtree").first )
return 1;
std::cout << "Parent: Container was properly destroyed by the child process\n";
}
//Child process
else
{
managed_shared_memory segment(open_only, "MySharedMemory");
std::cout << "Child: Searching of the container in shared memory\n";
Rtree * tree = segment.find<Rtree>("Rtree").first;
std::cout << "Child: Querying for objects intersecting box = [(45, 45)(55, 55)]\n";
std::vector<B> result;
unsigned k = tree->query(bgi::intersects(B(P(45, 45), P(55, 55))), std::back_inserter(result));
std::cout << "Child: Found objects:\n";
std::cout << k << "\n";
BOOST_FOREACH(B const& b, result)
{
std::cout << "[(" << bg::get<0>(b.min_corner()) << ", " << bg::get<1>(b.min_corner())
<< ")(" << bg::get<0>(b.max_corner()) << ", " << bg::get<1>(b.max_corner()) << ")]\n";
}
std::cout << "\n";
std::cout << "Child: Destroying container\n";
segment.destroy<Rtree>("Rtree");
}
return 0;
};
//]
|
15a19b180b398328fbb0b5c0666526313f6a5113 | 5d5a2a8deddb45364685507475c13a76c5e24867 | /Nodo.h | 7a89591bc31aa8554c3fdc43697d05f0879d4cb6 | [] | no_license | FrancescoDiBella/ALberoBinario | df88c1379dda7e2daffd2f9bea3aeffdb850e70d | 0d71c918a7f55492625168644298596389f6fd3f | refs/heads/main | 2023-05-07T09:20:27.600409 | 2021-05-31T16:00:36 | 2021-05-31T16:00:36 | 372,173,524 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,407 | h | Nodo.h | #pragma once
template <class T>
class Nodo{
private:
//Chiave del Nodo, tipo T
T key;
//Puntatore del Nodo, punta al Nodo Sinistro
Nodo<T>* left;
//Puntatore del Nodo, punta al Nodo Destro
Nodo<T>* right;
//Puntatore del Nodo, punta al Nodo Padre
Nodo<T>* padre;
public:
//Costruttore del Nodo, prende come argomento un oggetto di tipo Generico T
Nodo(T x);
Nodo();
~Nodo();
//Metodo setter per Key, prende come argomento un oggetto di tipo T
void setKey(T x);
//Metodo setter del puntatore Left, prende come argomento un puntatore a tipo Nodo<T>
void setLeft(Nodo<T>* x);
//Metodo setter del puntatore del Right, prende come argomento un puntatore al tipo Nodo<T>
void setRight(Nodo<T>* x);
//Metodo setter del puntatore del Padre, prende come argomento un puntatore al tipo Nodo<T>
void setPadre(Nodo<T>* x);
//Metodo getter di Key, restituisce un oggetto di tipo T
T getKey() const;
//Metodo getter di left, restituisce un puntatore a tipo Nodo<T>
Nodo<T>* getLeft() const;
//Metodo getter di right, restituisce un puntatore a tipo Nodo<T>
Nodo<T>* getRight() const;
//Metodo getter di padre, restituisce un puntatore a tipo Nodo<T>
Nodo<T>* getPadre() const;
}; |
31814738ac27627592df37be81a1d339aaaed333 | a04058c189ce651b85f363c51f6c718eeb254229 | /Src/Forms/DreamsMainForm.cpp | 7facd108e80616b7c3d70ff90c9820805a45e0b9 | [] | no_license | kjk/moriarty-palm | 090f42f61497ecf9cc232491c7f5351412fba1f3 | a83570063700f26c3553d5f331968af7dd8ff869 | refs/heads/master | 2016-09-05T19:04:53.233536 | 2006-04-04T06:51:31 | 2006-04-04T06:51:31 | 18,799 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 8,701 | cpp | DreamsMainForm.cpp | #include <Text.hpp>
#include <Definition.hpp>
#include <TextElement.hpp>
#include <LineBreakElement.hpp>
#include "MoriartyPreferences.hpp"
#include "LookupManager.hpp"
#include "HyperlinkHandler.hpp"
#include "DreamsMainForm.hpp"
#include "MoriartyStyles.hpp"
enum {
dreamTitleIndex,
dreamTextIndex
};
DreamsMainForm::DreamsMainForm(MoriartyApplication& app):
MoriartyForm(app, dreamsMainForm),
scrollBar_(*this),
doneButton_(*this),
dreamNameField_(*this),
searchButton_(*this),
displayMode_(showHelpText),
graffitiState_(*this),
helpText1Label_(*this),
helpText2Label_(*this),
helpText3Label_(*this),
dreamRenderer_(*this, &scrollBar_)
{
dreamRenderer_.setInteractionBehavior(
TextRenderer::behavHyperlinkNavigation
| TextRenderer::behavUpDownScroll
| TextRenderer::behavMenuBarCopyButton
| TextRenderer::behavMouseSelection
);
dreamRenderer_.setHyperlinkHandler(app.hyperlinkHandler);
setFocusControlId(dreamNameField);
}
DreamsMainForm::~DreamsMainForm() {}
void DreamsMainForm::attachControls()
{
MoriartyForm::attachControls();
scrollBar_.attach(definitionScrollBar);
dreamRenderer_.attach(dreamRenderer);
dreamRenderer_.setNavOrderOptions(TextRenderer::navOrderFirst);
doneButton_.attach(doneButton);
dreamNameField_.attach(dreamNameField);
searchButton_.attach(searchButton);
helpText1Label_.attach(helpText1Label);
helpText2Label_.attach(helpText2Label);
helpText3Label_.attach(helpText3Label);
graffitiState_.attachByIndex(getGraffitiStateIndex());
}
bool DreamsMainForm::handleOpen()
{
bool result=MoriartyForm::handleOpen();
MoriartyApplication& app=application();
LookupManager* lookupManager=app.lookupManager;
assert(0!=lookupManager);
if (!lookupManager->dream.empty())
setDisplayMode(showDream);
else
setDisplayMode(displayMode_);
return result;
}
void DreamsMainForm::resize(const ArsRectangle& screenBounds)
{
ArsRectangle bounds;
this->bounds(bounds);
if (screenBounds == bounds)
return;
setBounds(bounds=screenBounds);
dreamRenderer_.anchor(screenBounds, anchorRightEdge, 8, anchorBottomEdge, 36);
scrollBar_.anchor(screenBounds, anchorLeftEdge, 7, anchorBottomEdge, 36);
doneButton_.bounds(bounds);
bounds.y()=screenBounds.height()-14;
doneButton_.setBounds(bounds);
dreamNameField_.bounds(bounds);
bounds.y()=screenBounds.height()-14;
bounds.width()=screenBounds.width()-94;
dreamNameField_.setBounds(bounds);
searchButton_.bounds(bounds);
bounds.y()=screenBounds.height()-14;
bounds.x()=screenBounds.width()-44;
searchButton_.setBounds(bounds);
graffitiState_.bounds(bounds);
bounds.y() = screenBounds.height() - 13;
bounds.x() = screenBounds.width() - 55;
graffitiState_.setBounds(bounds);
helpText1Label_.bounds(bounds);
bounds.y() = screenBounds.height() - 53;
helpText1Label_.setBounds(bounds);
helpText2Label_.bounds(bounds);
bounds.y() = screenBounds.height() - 41;
helpText2Label_.setBounds(bounds);
helpText3Label_.bounds(bounds);
bounds.y() = screenBounds.height() - 29;
helpText3Label_.setBounds(bounds);
update();
}
bool DreamsMainForm::handleEvent(EventType& event)
{
if (showDream == displayMode_ && dreamRenderer_.handleEventInForm(event))
return true;
bool handled = false;
switch (event.eType)
{
case ctlSelectEvent:
handleControlSelect(event);
handled = true;
break;
case keyDownEvent:
handled = handleKeyPress(event);
break;
case LookupManager::lookupFinishedEvent:
handleLookupFinished(event);
handled = true;
break;
default:
handled=MoriartyForm::handleEvent(event);
}
return handled;
}
bool DreamsMainForm::handleMenuCommand(UInt16 itemId)
{
bool handled=false;
switch (itemId)
{
case mainPageMenuItem:
doneButton_.hit();
handled=true;
break;
default:
assert(false);
}
return handled;
}
void DreamsMainForm::setHelpTextVisible(bool visible)
{
if (visible)
{
helpText1Label_.show();
helpText2Label_.show();
helpText3Label_.show();
}
else
{
helpText1Label_.hide();
helpText2Label_.hide();
helpText3Label_.hide();
}
}
void DreamsMainForm::setDisplayMode(DreamsMainForm::DisplayMode dm)
{
switch (displayMode_=dm)
{
case showDream:
if (dreamRenderer_.empty())
prepareDream();
scrollBar_.show();
dreamRenderer_.show();
setHelpTextVisible(false);
scrollBar_.show();
break;
case showHelpText:
scrollBar_.hide();
dreamRenderer_.hide();
setHelpTextVisible(true);
break;
default:
assert(false);
}
}
void DreamsMainForm::handleSearch()
{
char* dreamName = dreamNameField_.textCopy();
if (NULL == dreamName)
return;
StrStrip(dreamName);
if (StrEmpty(dreamName))
goto Exit;
LookupManager* lookupManager=application().lookupManager;
assert(0!=lookupManager);
lookupManager->fetchField(getDreamsField, dreamName);
Exit:
if (NULL != dreamName)
free(dreamName);
}
void DreamsMainForm::handleControlSelect(const EventType& event)
{
switch (event.data.ctlSelect.controlID)
{
case doneButton:
application().runMainForm();
break;
case searchButton:
handleSearch();
break;
default:
assert(false);
}
}
void DreamsMainForm::prepareDream()
{
const LookupManager* lookupManager=application().lookupManager;
assert(0!=lookupManager);
const UniversalDataFormat& dream=lookupManager->dream;
assert(!dream.empty());
DefinitionModel* model = new_nt DefinitionModel();
if (NULL == model)
{
application().alert(notEnoughMemoryAlert);
return;
}
Definition::Elements_t& elems = model->elements;
TextElement* text;
for (int i = 0; i < dream.getItemsCount(); i++)
{
if (2 == dream.getItemElementsCount(i))
{
elems.push_back(text=new TextElement(dream.getItemText(i, dreamTitleIndex)));
text->setStyle(StyleGetStaticStyle(styleNameHeader));
elems.push_back(new LineBreakElement());
String str;
str = dream.getItemText(i, dreamTextIndex);
parseSimpleFormatting(elems, str, true, urlSchemaDream);
elems.push_back(new LineBreakElement());
elems.push_back(new LineBreakElement());
}
else if (1 == dream.getItemElementsCount(i))
{
elems.push_back(text=new TextElement(dream.getItemText(i, dreamTitleIndex)));
text->setStyle(StyleGetStaticStyle(styleNamePageTitle));
text->setJustification(DefinitionElement::justifyCenter);
elems.push_back(new LineBreakElement());
}
}
dreamRenderer_.setModel(model, Definition::ownModel);
}
void DreamsMainForm::handleLookupFinished(const EventType& event)
{
const LookupFinishedEventData& data=reinterpret_cast<const LookupFinishedEventData&>(event.data);
switch (data.result)
{
case lookupResultDreamData:
prepareDream();
if (showDream != displayMode_)
setDisplayMode(showDream);
update();
MoriartyApplication::touchModule(moduleIdDreams);
break;
}
MoriartyApplication& app=application();
LookupManager* lookupManager=app.lookupManager;
assert(0!=lookupManager);
lookupManager->handleLookupFinishedInForm(data);
}
bool DreamsMainForm::handleKeyPress(const EventType& event)
{
bool handled = false;
switch (event.data.keyDown.chr)
{
case chrLineFeed:
case chrCarriageReturn:
searchButton_.hit();
handled=true;
}
return handled;
}
|
61647bbf4446d7a460f617331c5c08584c094239 | 2a45507fff25c42cad05b52d83d011fea0909be5 | /Gfg/C++/nCr.cpp | b482f59c08a45be879961aac15760139d0c7e39f | [
"MIT"
] | permissive | Sharayu1071/Daily-Coding-DS-ALGO-Practice | dc8256e76d43952f679236df904f597908fbda13 | 2c424b33a1385085f97b98d6379d6cd9cc71b1bd | refs/heads/main | 2023-08-30T17:49:44.312613 | 2021-10-03T04:21:21 | 2021-10-03T04:21:21 | 412,973,714 | 3 | 0 | MIT | 2021-10-03T04:18:20 | 2021-10-03T04:18:19 | null | UTF-8 | C++ | false | false | 538 | cpp | nCr.cpp | // Binomial cofficient problem of Dynamic Programming
int nCrModp(int n, int r, int p)
{
int C[r+1];
memset(C, 0, sizeof(C));
C[0] = 1;
for (int i = 1; i <= n; i++)
{
for (int j = min(i, r); j > 0; j--)
C[j] = (C[j] + C[j-1])%p;
}
return C[r];
}
int main()
{
int t;
cin>>t;
while(t--)
{
int n,r;
cin>>n>>r;
/*if(r>n)
{
cout<<"0\n";
}*/
int p=1000000007;
cout<<nCrModp(n,r,p)<<" \n";
}
//code
return 0;
}
|
24a0231effd333af39d0ba8e490b0bfdbad1017e | e2a7a60e13303bde79e926d45fb75aa430c3a596 | /12160.cpp | 0c743d80e381f8ff64377287cd6bd269bb3ee8a9 | [] | no_license | jonathandarryl/UVa-Code | 9ab900ee87e67469ffaa753ae57e070ed60d0b8c | 0cbe8b6e091fc699abba25cbd72ebf1aa9e1709d | refs/heads/master | 2016-09-05T15:45:46.105512 | 2015-01-08T05:16:31 | 2015-01-08T05:16:31 | 27,748,480 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,056 | cpp | 12160.cpp | #include<stdio.h>
#include<iostream>
#include<queue>
using namespace std;
int main(void){
int L, U, R,casenum=0;
int verify[10000];
bool arr[10000];
bool found;
int adder[10];
while(cin>>L>>U>>R && (L||U||R)){
found = false;
for(int i=0;i<R;i++)
cin>>adder[i];
for(int i=0;i<10000;i++){
verify[i] = 0;
arr[i] = false;
}
queue<int> q;
q.push(L);
verify[L] = 0;
while(!q.empty()){
int x = q.front();
q.pop();
if(x==U){
found = true;
printf("Case %d: %d\n",++casenum,verify[U]);
break;
}
for(int i=0;i<R;i++){
int y = (x+adder[i])%10000;
if(!arr[y]){
arr[y] = true;
verify[y]=verify[x]+1;
q.push(y);
}
}
}
if(!found)
printf("Case %d: Permanently Locked\n",++casenum);
}
}
|
60bbec50980124e83dfda2ec8e22dee19c0cb875 | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5630113748090880_1/C++/khaihanhdk/b.cpp | d428ac1f7df423b8040681fa8415892cda27d0e6 | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 798 | cpp | b.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int a[10000];
int main()
{
freopen("d:\\B-large.in", "r", stdin);
freopen("d:\\output.txt", "w", stdout);
int oo;
scanf("%d", &oo);
for(int o = 0; o < oo; o++)
{
int n;
scanf("%d", &n);
int m = 2 * n - 1;
memset(a, 0, sizeof(a));
for(int i = 0; i < m; i++)
{
for(int j = 0; j < n; j++)
{
int x;
scanf("%d", &x);
a[x]++;
}
}
printf("Case #%d:", o +1);
int ccc = 0;
for(int i = 0; i <= 9000; i++)
if (a[i] % 2 != 0)
printf(" %d", i);
printf("\n");
}
}
|
ca714f63bcd492ddb8809bcc841f28fcd6b5e07d | 198fbd6b6b09a457a333e2eef2946da25bf55f99 | /project/os1/kernel/trap.cpp | c7d955b99d68b2a1e962685084781e5cd9fe7523 | [] | no_license | WeiJiLab/os | 2f72b58f0d6720dac7c237041c7203759c6d2a18 | e746fb741b356700e8e343848db25b25b45f48cc | refs/heads/master | 2023-04-23T23:37:51.994548 | 2021-05-06T05:03:42 | 2021-05-06T05:03:42 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 14,695 | cpp | trap.cpp |
#include<const.h>
#include<io.h>
#include<process.h>
#include<ram_addr.h>
#include<global_cite.h>
#include<message_cite.h>
#include<message_types.h>
#include <8259a.h>
extern void print_string(char*strp,int color,int row,int col);
extern void print_int(int disp,int color,int row,int col);
extern void print_char(char strp,int color,int row,int col);
extern void time_int();
extern void kb_int();
extern void save_curse(int x,int y);
extern void move_curse(int row,int col);
extern void key_place_control(int dis,int attr);
extern void my_task_1();
extern void my_task_2();
extern void send_message_to_kernal(msg tmp_msg);
extern void disp_color(int begx,int begy,int endx,int endy,int color);
extern void set_vga_mode();
//extern void disp_color(int,int,int,int,int);
extern void openmov();
char key_make_code[0x27]={"qwertyuiop[]ECasdfghjkl;'`S\\zxcvbnm,./"};
int key_place_control_sel=1;
//修改gdt/idt描述符
//atr属性,第no个。base,基址。limit,界限。attribute,属性。
void modify_descriptor(desc_struct*addr,int no,bit_32 base,bit_32 limit,bit_16 attribute)
{
addr=addr+no;
//---
addr->limit_l_1=limit&0x0ff; //段界限1(16位)
addr->limit_l_2=(limit>>8)&0x0ff;
addr->base_l_1=base&0x0ff; //段基址1(16位)
addr->base_l_2=(base>>8)&0x0ff;
addr->base_m=(base>>16)&0xff;
addr->attr1=attribute&0xff;
addr->limit_high_attr2=((limit>>16)&0xf)|(attribute>>8)&0xf0;
addr->base_h=(base>>24)&0xff;
//g,d,0,avl=0000.tss is 16 bit segment.
}
void init_tss(task_struct*p,int i,int task_addr)
{
p[i].tss.stack0_len=&(p[i].stack_0[1024*4-1])-&(p[i].stack_0[0]);
p[i].tss.stack0_sel=2*8+til;//stack 0.
p[i].tss.cr3=0x120000;//--
p[i].tss.eip=task_addr;//(bit_32)my_task_0; //段内偏移。
p[i].tss.eflags=0x0202;
p[i].tss.esp=(bit_32)&(p[i].stack_0[1024*4-1]);
p[i].tss.cs_sel=1*8+til;//in ldt.0,null.1,code.
p[i].tss.ds_sel=2*8+til;
p[i].tss.ss_sel=2*8+til;//--32bit,not 16bit.--
p[i].tss.es_sel=2*8+til;
p[i].tss.fs_sel=2*8+til;
p[i].tss.gs_sel=2*8+til;
p[i].tss.ldtr=(6+i*2)*8; //0,null.1,code.2,data.3,tss0.4,ldt0. in gdt.
//-left i/o.
p[i].tss.link=0;
p[i].tss.bitmap=0xff;
p[i].tss.tss_attr=0;
p[i].tss.trace_bitmap=&(p[i].tss.bitmap)-(char*)&(p[i].tss.link);
p[i].tss.eax=0;
p[i].tss.ebx=0;
p[i].tss.ecx=0;
p[i].tss.edx=0;
p[i].tss.ebp=0;
p[i].tss.esi=0;
p[i].tss.edi=0;
}
void init_ldt(task_struct*p,int i)
{
//only a code.
modify_descriptor(p[i].ldt,1,0x0,0xfffff,at_code_exe+d_32);//code //函数名表示地址。
modify_descriptor(p[i].ldt,2,0x0,0xfffff,at_data_write+d_32);//data
}
int find_next_process()
{
//根据process_ing_no找到下一个进程号。
//同时将当前进程状态设为ready。
int pid;
//while(1);
//state[2]=p_ed;
//state[1]=p_ed;
if(state[last_task_no]!=task_status_zombie)
state[last_task_no]=task_status_ready;
//这样如果只有一个内核进程的话,最终下面的循环还会找到内核进程。
if(last_task_no==my_task_no-1)pid=0;//最后一个。
else pid=last_task_no+1;
//int j=0;
while(pid<my_task_no)
{
if(state[pid]==task_status_ready)
return pid;
if(pid==my_task_no-1)pid=0;//for(;;i++)
else pid++;
}
}
void f_time_int()
{
/* process id */
unsigned int pid;
struct tmp_jmp_addr{long a,b;}tmp;
/* display */
if(text_g==0)
print_char(int_c,12,11,39);
else
disp_color(70,70,90,90,int_c%16);
int_c++;
//----
//time_int_switch=((time_int_switch++)&0x1)*2+5;
//print_int(process_ing_no,15,16,numtt);
//print_int(last_task_no,15,19,t2++);
//print_int(process_ing_no,14,22,t5++);
/* look for next process */
pid=find_next_process();
//---------------------------
//窗口消息的控制。
if(pid==3)//window 1
time_window_no=1;
if(pid==4)//window 2
time_window_no=2;
/* display */
if(text_g)
{disp_color(11,51,20,60,active_window_id%16);disp_color(11,61,20,70,time_window_no%16);}
//---------------------------
if(last_task_no==pid)//仅剩下内核进程了。
{
send_master_8259a_eoi();
//outb(0xa0,0x20);
//outb(0x20,0x20);//open 8259.
}
else
{
//while(1);
last_task_no=pid;
state[pid]=task_status_running;
//__asm__("ljmp %0,$0x0"::"L"(npn*8):);
tmp.b=0;//clear high bit。
tmp.b=(5+pid*2)*8;
send_master_8259a_eoi();
//outb(0xa0,0x20);
//outb(0x20,0x20);
__asm__ __volatile__("ljmp %0\n\t"\
::"m"(tmp):);//*&的妙用。
} //总是有烦人的警告。
//虽然不断尝试,但是ljmp使用2个参数的时候,似乎不能传参数。
//只能使用1个参数的形式来进行ljmp。
// unsigned int npn;
// struct{long a,b;}tmp;
// //---
// print_char(int_c,12,11,39);
// int_c++;
// //----
// //time_int_switch=((time_int_switch++)&0x1)*2+5;
// npn=find_next_process();
// if(last_task_no==npn)//仅剩下内核进程了。
// outb(0x20,0x20);//open 8259.
// else
// {
// last_task_no=npn;
// state[npn]=p_ing;
// outb(0x20,0x20);
// //__asm__("ljmp %0,$0x0"::"L"(npn*8):);
// tmp.b=0;//clear high bit。
// tmp.b=(3+npn*2)*8;
// __asm__ __volatile__("ljmp %0\n\t"\
// ::"m"(*&tmp.a):);//*&的妙用。
// } //总是有烦人的警告。
// //----
// //print_int(npn,15,11,10);
// //print_int(time_int_switch,15,11,11);
// //----
// if(npn==last_task_no)//是其本身,只剩内核进程了。npn=3.
// outb(0x20,0x20);
// else
// {
// if(npn==5)
// {
// last_task_no=5;
// state[1]=p_ing;
// outb(0x20,0x20);
// __asm__("ljmp $5*8,$0x0");//不能再返回内核了。
// }
// if(npn==7)
// {
// last_task_no=7;
// state[2]=p_ing;
// outb(0x20,0x20);
// __asm__("ljmp $7*8,$0x0");
// }
// if(npn==3)
// {
// last_task_no=3;
// outb(0x20,0x20);
// __asm__("ljmp $3*8,$0x0");
// }
// }
// //----
// //outb(0x20,0x20);
}
void modify_int(void (*p)(),int no)
{
__asm__ __volatile__("cli;\
movl %1,%%edi;\
movl %0,%%edx;\
movl $0x80000,%%eax;\
movw %%dx,%%ax;\
movw $0x8e00,%%dx;\
movl %%eax,(%%edi);\
movl %%edx,4(%%edi);"\
:
:"c"(p),"b"(no*8+0x100000) //此处已经是地址值了,不用lea
:"%edi","%eax","%edx");
}
void os_int_install(void (*p)(),int no)
{
modify_int(p, no);
}
void init_state()
{
state[0]=state[1]=state[2]=task_status_ready;
//state[1]=p_ing; //init
state[0]=task_status_running;
//process_ing_no=1;
}
void init_switch()
{
last_task_no=0;//1;
//time_int_switch=5;
}
void open_time_int()
{
__asm__ __volatile__("cli;\
inb $0x21,%%al;\
movb %%al,%%ah;\
andb $0xfe,%%ah;\
movb %%ah,%%al;\
outb %%al,$0x21"\
:
:
:"%eax");
}
void test_time_int()
{
//*****************
int task_0,task_1,task_2;
task_0=0;
task_1=1;
task_2=2;
//---------------------------------------------------------------
process_table[task_1].pid=0x12345678;//find it
init_tss(process_table,task_1,(bit_32)my_task_1); //task 0
init_ldt(process_table,task_1);
//--//o,null.1,code.2,data.--
modify_descriptor(gdt_addr,7,(bit_32)(&(process_table[task_1].tss)),0xfffff,at_386_tss+d_32);//tss0 0x12345678
modify_descriptor(gdt_addr,8,(bit_32)(process_table[task_1].ldt),0xfffff,at_ldt+d_32);//ldt
//---------------------------------------------------------------
process_table[task_1].pid=0x11111111;
init_tss(process_table,task_2,(bit_32)my_task_2); //task 1
init_ldt(process_table,task_2);
//--//o,null.1,code.2,data.--
modify_descriptor(gdt_addr,9,(bit_32)(&(process_table[task_2].tss)),0xfffff,at_386_tss+d_32);
modify_descriptor(gdt_addr,10,(bit_32)(process_table[task_2].ldt),0xfffff,at_ldt+d_32);
//--------------------temp task-----------------------------------
process_table[task_0].pid=0x10101010;
init_tss(process_table,task_0,0); //不需要初始化,所以只写了个0。
init_ldt(process_table,task_0);
//--
modify_descriptor(gdt_addr,5,(bit_32)(&(process_table[task_0].tss)),0xfffff,at_386_tss+d_32);
modify_descriptor(gdt_addr,6,(bit_32)(process_table[task_0].ldt),0xfffff,at_ldt+d_32);//****
//**********************
//=========================================================================
//增加一个16位段的选择子。
//modify_descriptor(gdt_addr,9,0,0xfffff,at_386_tss+d_32);
//=========================================================================
init_state();
init_switch();
//-----
#if 0
/* init 8253/8254, channel 0. timer is 10ms. */
outb_p(0x43, 0x36);
outb_p(0x40, (1193180/100) & 0xff);
outb(0x40, (1193180/100) >> 8);
#endif
modify_int(time_int,0x20);
open_time_int();
int_c='#';
active_window_id=0;
// __asm__("sti");
// __asm__ __volatile__("ltr %%ax;\
// ljmp $7*8,$0x2000"\
// :
// :"a"(5*8)); //保存内核任务状态.
// //__asm__("int $0x20");//先显示一个。
__asm__ __volatile__("ltr %%ax;\
sti"\
:
:"a"(5*8));
}
void debug_break()
{
;
}
void f_kb_int()
{
__asm__("cli");
unsigned char scan_code;
msg keyboardmsg;
keyboardmsg.hwnd=active_window_id;
keyboardmsg.message=msg_keyboard;
inb(0x60,scan_code);
if(text_g)
disp_color(1,41,10,50,scan_code%16);
#if 0
/* 换心脏 */
if ((0x3c == scan_code) && (task_status_running == state[0]))
{
debug_break();
/* 具体的地址参照map文件 */
#if 0
__asm__("ljmp 0x00820290\n");
译成了ljmp ds:0x820290
#endif
if (1)
{
set_vga_mode();//new
//dead();
outb(0x3ce,0x5);
outb(0x3cf,0x6);
text_g=1;
openmov();//开机画面。
while(1);
}
__asm__ __volatile__("movl $0x00820290,%%eax;\
jmp %%eax;"\
:
:
:"%eax");
}
#endif
if(scan_code>1&&scan_code<0xc)//num
{//disp_color(500,400,539,479,2);
if(text_g==1)
{
keyboardmsg.wparam=scan_code-1;
send_message_to_kernal(keyboardmsg);
}
else
{
//图形界面和消息机制,下面的没用。
if(key_place_control_sel)//需要改变位置
key_place_control(scan_code-1,0);
else
{
print_int(scan_code-1,15,*curse_x,*curse_y);
save_curse(*curse_x,*curse_y+1);
move_curse(*curse_x,*curse_y);
}
}
}
if(scan_code>0xf&&scan_code<0x36)
{//disp_color(500,400,539,479,4);
if(text_g==1)
{
keyboardmsg.wparam=scan_code-0x10+0xb;
send_message_to_kernal(keyboardmsg);
//图形界面和消息机制,下面的没用。
}
else
{
if(key_place_control_sel)
key_place_control(key_make_code[scan_code-0x10],1);
else
{
print_char(key_make_code[scan_code-0x10],15,*curse_x,*curse_y);
save_curse(*curse_x,*curse_y+1);
move_curse(*curse_x,*curse_y);
}
}
}
if(text_g==1)
{
if(scan_code==0xf)//tab键,就暂时用这个做活动窗口的切换。
active_window_id=(active_window_id+1)%window_count;//加1式的切换。
}
__asm__("sti");
if(text_g)
{disp_color(1,51,10,60,active_window_id%16);disp_color(1,61,10,70,time_window_no%16);}
send_master_8259a_eoi();
//outb(0xa0,0x20);
//outb(0x20,0x20);
}
void open_kb_int()
{
__asm__ __volatile__("cli;\
inb $0x21,%%al;\
movb %%al,%%ah;\
andb $0xfd,%%ah;\
movb %%ah,%%al;\
outb %%al,$0x21"\
:
:
:"%eax");
}
void test_keyboard_int()
{
//print_char('d',15,20,1);
modify_int(kb_int,0x21);
open_kb_int();
__asm__("sti");
//__asm__("int $0x21");
}
|
d2455cd1d7fbe5bf16ed0fe540582af6f80ab294 | 6ae43c682d4f0ed4c80ae1d72f0f57af6a9170f3 | /src/Transaction.h | d23cc2704e86d9e16c2ba96af867511a9cfe9bd3 | [
"MIT"
] | permissive | elastos/Elastos.SDK.Wallet.C | 358f5a262ae0a4925c5578eadd5d3345d12a532d | 96737c28712d82eca729d5d9485311ed0602bca1 | refs/heads/master | 2021-07-07T14:11:04.649193 | 2020-07-26T02:39:42 | 2020-07-26T02:39:42 | 158,508,154 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 570 | h | Transaction.h |
#ifndef __TRANSACTION_H__
#define __TRANSACTION_H__
#include <string>
extern "C" {
extern const int COIN_TYPE_ELA;
}
namespace elastos {
class Transaction
{
public:
Transaction(const std::string& address, long amount, int coinType = COIN_TYPE_ELA);
void SetAddress(const std::string& address, int coinType);
void SetAmount(long amount);
int GetCoinType();
std::string GetAddress();
long GetAmount();
private:
std::string mAddress;
long mAmount = 0;
int mCoinType = 0;
};
} //namespace elastos
#endif // __TRANSACTION_H__
|
91c9351a855c937d7231d11bda7ce85509be5e1a | 6de138da99ec057232d35ff0b6d549c11c9db064 | /COJ/2688 - Numerical Set.cpp | 1ccc6058af2c7b8c5c48361e8a75cd987a895a4d | [] | no_license | jvillarreal7/Online-Judges | f63c9a35afd62db0bce3ac8e55b0da6198f320f6 | 1ec329a17721da2c7713460814a630c69a35f6dc | refs/heads/master | 2022-07-04T01:50:52.684583 | 2022-06-18T18:44:19 | 2022-06-18T18:44:19 | 32,905,940 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,117 | cpp | 2688 - Numerical Set.cpp | //This problem won't be judged using numbers with more than 1 digit. Char vectors for both sets will suffice.
//"ph" just holds the first word for each set input. Oddily, this word seems to vary during judgement too.
//So implementing a substring algorithm with fixed positions to extract all the data ended up being a huge waste of time lol.
#include <iostream>
#include <vector>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <set>
#include <cstdio>
using namespace std;
int main()
{
cin.tie(0);
ios::sync_with_stdio(0);
vector<char> set1;
vector<char> set2;
string setName1,setName2,ph,a;
int s1,s2;
cin>>ph>>setName1>>s1;
for(int i = 0; i < s1; i++)
{
char x;
cin>>x;
set1.push_back(x);
}
getline(cin,ph);
cin>>ph>>setName2>>s2;
for(int i = 0; i < s2; i++)
{
char x;
cin>>x;
set2.push_back(x);
}
sort(set1.begin(), set1.end());
sort(set2.begin(), set2.end());
vector<char> t; //Temporal vector holding all the resulting sets. Can be done with actual sets too.
set_union(set1.begin(), set1.end(), set2.begin(), set2.end(), back_inserter(t));
cout<<setName1<<" U "<<setName2<<": {";
for(int i = 0; i < t.size(); i++)
{
cout<<t.at(i);
if(i != t.size()-1)
{
cout<<",";
}
}
cout<<"}"<<'\n';
t.clear(); //Wipes temporal vector so it can be used again.
set_intersection(set1.begin(), set1.end(), set2.begin(), set2.end(), back_inserter(t));
cout<<setName1<<" I "<<setName2<<": {";
for(int i = 0; i < t.size(); i++)
{
cout<<t.at(i);
if(i != t.size()-1)
{
cout<<",";
}
}
cout<<"}"<<'\n';
t.clear();
set_difference(set1.begin(), set1.end(), set2.begin(), set2.end(), back_inserter(t));
cout<<setName1<<" D "<<setName2<<": {";
for(int i = 0; i < t.size(); i++)
{
cout<<t.at(i);
if(i != t.size()-1)
{
cout<<",";
}
}
cout<<"}"<<'\n';
t.clear();
set_difference(set2.begin(), set2.end(), set1.begin(), set1.end(), back_inserter(t));
cout<<setName2<<" D "<<setName1<<": {";
for(int i = 0; i < t.size(); i++)
{
cout<<t.at(i);
if(i != t.size()-1)
{
cout<<",";
}
}
cout<<"}"<<'\n';
return 0;
}
|
c72c7dd76f0d9a3bab42ec7a09f78df3b3a53e43 | 17ac2775f83f3856df762de1cf3b47b6ede35021 | /TestServer/Handlers/sendmessagehandler.cpp | 650dead2af243f3275f4142544c583903b40e0d5 | [] | no_license | usazankov/Chat | b51f31e0264d8e7867aef8abf8698696da5df0b7 | 75857a24a44dd431001a2ef0965a36828025f3b9 | refs/heads/master | 2021-07-08T19:05:02.012726 | 2018-12-27T15:47:50 | 2018-12-27T15:47:50 | 130,215,993 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,269 | cpp | sendmessagehandler.cpp | #include "sendmessagehandler.h"
SendMessageHandler::SendMessageHandler()
{
}
SendMessageHandler::SendMessageHandler(QJsonDocument *doc) : SendDataHandler(doc)
{
this->doc = doc;
}
ClientCommandPtr SendMessageHandler::data() const
{
ClientCommandPtr com(new ClientCommand);
com->result = server_consts::UndefinedError;
com->type = server_consts::SendToThisClient;
QJsonObject obj = doc->object();
QString userId;
QString message;
if(obj.contains(chat::USER_ID)){
userId = obj.value(chat::USER_ID).toString();
}else{
com->result = server_consts::MissingUserID;
return com;
}
if(userId.isEmpty()){
com->result = server_consts::MissingUserID;
return com;
}
if(obj.contains(chat::MESSAGE_OBJ) && obj.value(chat::MESSAGE_OBJ).isObject()){
QJsonObject mes = obj.value(chat::MESSAGE_OBJ).toObject();
if(mes.contains(chat::MESSAGE_BODY)){
message = mes.value(chat::MESSAGE_BODY).toString();
}
}
if(message.isEmpty()){
com->result = server_consts::EmptyMessage;
return com;
}else{
//Остальных клиентов оповещаем о новом сообщении
chat::ChatRequest req;
req.addChildObj(chat::EVENT_OBJ, chat::ChatRequest(chat::EVENT_ID, chat::E_MESSAGE));
req.addChildObj(chat::USER_OBJ, chat::ChatRequest(chat::USER_ID, userId));
req.addChildObj(chat::MESSAGE_OBJ, chat::ChatRequest(chat::MESSAGE_BODY, message));
com->data = req;
com->type = server_consts::SendToAllClient;
com->result = server_consts::SUCCESS;
//Клиенту, который создал запрос, отсылаем, что сообщение доставлено
ClientCommandPtr comSuccess(new ClientCommand);
comSuccess->type = server_consts::SendToThisClient;
comSuccess->result = server_consts::SUCCESS;
com->com_onSuccess = comSuccess;
//В случае ошибки
ClientCommandPtr comError(new ClientCommand);
comError->type = server_consts::SendToThisClient;
comError->result = server_consts::UndefinedError;
com->com_onError = comError;
}
return com;
}
|
4a0fadcdd1cd30e45d5ff7325ffc55ae737d8e99 | 205683333c85d3e18207a60c029aa5cbac708c28 | /1068.cpp | 5749c180798b6f809f75693afb7af9d25e1fdb04 | [] | no_license | CiderCan/SW_Algorithm_Test | e9083b581f1683145e475b238dd9bb8b6f3b787e | c38e8af0d1f27d9eb30ec7db21dd48c8b199063e | refs/heads/master | 2020-03-11T02:38:32.455083 | 2018-04-16T10:27:43 | 2018-04-16T10:27:43 | 129,724,872 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 901 | cpp | 1068.cpp | #include <iostream>
#include <vector>
using namespace std;
int tree[50];
bool check[50] = { 0, };
void removeNode(int r, int N) {
for (int i = 0; i < N; i++) {
if (tree[i] == r) {
removeNode(i, N);
tree[i] = -2;
}
}
}
void search(int i) {
if (!check[i]) {
check[i] = true;
}
if (i == -1) {
return;
}
search(tree[i]);
}
void printTree(int N) {
for (int i = 0; i < N; i++) {
cout << tree[i] << " ";
}
cout << endl;
}
int main() {
int N;
cin >> N;
for (int i = 0; i < N; i++) {
int num;
cin >> num;
tree[i] = num;
}
//printTree(N);
int remove;
cin >> remove;
tree[remove] = -2;
removeNode(remove, N);
//printTree(N);
for (int i = 0; i < N; i++) {
if (tree[i] != -2) {
search(tree[i]);
}
}
int count = 0;
for (int i = 0; i < N; i++) {
if (!check[i] && tree[i] != -2) {
count++;
}
}
cout << count << endl;
system("pause");
} |
04dfbd4851394a9343b4c590b1af77e1ffbdb403 | fd2149f2068d6d4aac49a0559d8db23b626ce440 | /keyboard/widgetKeyBoard.h | 5d35e702174fbca402e87828e9d42ef87e77b90b | [] | no_license | stmmcu/qt-widget-virtual-keyboard | d407aa327e659e9733ffcaf5a61aa765c1771831 | 5600caba31ec5afe9a34d5d1c4dc1c94b5c031a1 | refs/heads/main | 2023-03-25T02:29:57.191577 | 2021-03-23T16:54:36 | 2021-03-23T16:54:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,260 | h | widgetKeyBoard.h | #ifndef _WIDGETKEYBOARD_H
#define _WIDGETKEYBOARD_H
#include "QKeyPushButton.h"
#include <QSound>
#include <QLineEdit>
#include <QClipboard>
#include <QLabel>
//
//
// class that creates and controls the keyboard:
class widgetKeyBoard : public QWidget {
Q_OBJECT
public:
widgetKeyBoard(bool embeddedKeyboard = false, QWidget *activeForm = NULL, bool onlyNumericPad = false, QWidget *parent = NULL);
~widgetKeyBoard();
void createKeyboard();
bool isEmbeddedKeyboard(void);
bool statusEchoMode(void){return (this->m_echoMode);}
void setStatusEchoMode(bool echo) {this->m_echoMode = echo; }
void receiptChildKey(QKeyEvent *event, QLineEdit *focusThisControl, bool reset = false); // welcomes the keys pressed
QLineEdit * currentTextBox(void) { return (this->m_currentTextBox);}
void switchKeyEchoMode(QLineEdit *control);
void enableSwitchingEcho(bool status); // if you don't want control echo from keyboard
bool isEnabledSwitchingEcho(void); // current status
void borderFrame(bool visible = true);
bool isNumericPad();
QKeyPushButton* returnPushButton;
public slots:
void show(QWidget *activeForm, QLineEdit *first = NULL, bool frameless = false);
void hide(bool noChangeColor);
void focusThis(QLineEdit *control);
void returnKeySignalReceived();
signals:
void keySignalReceived();
protected:
virtual void closeEvent(QCloseEvent * event);
private:
widgetKeyBoard(const widgetKeyBoard&);
widgetKeyBoard& operator=(const widgetKeyBoard&);
void init_keyboard(QLineEdit *focusThisControl); // reinitializes the basic functions of the keyboard
QLineEdit * setCurrentTextStyle(QLineEdit *control);
QLineEdit * setDefaultTextStyle(QLineEdit *control);
QKeyPushButton *createNewKey(QString keyValue);
QLineEdit * getNextTextbox(QLineEdit *thisControl = NULL, bool reset = false);
void controlKeyEcho(QLineEdit *control);
private:
QLineEdit m_noFocusPalette; // used to restore unfocused linetext
QWidget *m_nextInput; // points to the textbox currently in focus
QWidget *m_activeWindow;
QLineEdit *m_currentTextBox; // It maintains the reference to the currently in use box
QLabel *m_zoomedKey; // used for zoomed pressed key
bool m_embeddedKeyboard;
bool m_echoMode; // status of current text object for echo
bool m_zoomFacilityEmbedded;
bool m_enablePasswordEcho; // controls the possibility to change among normal/password echo
bool m_numericPad;
QClipboard *m_clipboard;
};
#endif // _WIDGETKEYBOARD_H
|
03778f4e990bd48f9edba6426d44661f85cdbeba | fdef3f2486422f62e3c8d93612803da46654ca05 | /MyProject.cp | 80bfa08537650e58cf5393ac4d571ba8c03a2615 | [] | no_license | mohamedalikalil/Traffic-light-by-using-Seven-segment | 84decc34b3f6d86310dad7fd317d0cfd3b9568d9 | b2b1ecd1334fc66692c120ec274edcfe7a112533 | refs/heads/master | 2020-03-23T02:59:10.966466 | 2018-07-15T06:05:51 | 2018-07-15T06:05:51 | 141,002,696 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 832 | cp | MyProject.cp | #line 1 "F:/Training 2/Code programe/Task/Seven segment4/MyProject.c"
void main() {
trisb=0x00;
trisc=0x00;
portb=0;
portc=0;
while(1)
{
portb= 0x67;
delay_ms(500);
portb= 0x7F;
delay_ms(500);
portb= 0x07;
delay_ms(500);
portb= 0x7D;
delay_ms(500);
portb= 0x6D;
delay_ms(500);
portb= 0x66;
delay_ms(500);
portb= 0x4F;
delay_ms(500);
portb= 0x5B;
delay_ms(500);
portb= 0x06;
delay_ms(500);
portb= 0x3F;
delay_ms(500);
portb= 0x00;
portc= 0x67;
delay_ms(500);
portc= 0x7F;
delay_ms(500);
portc= 0x07;
delay_ms(500);
portc= 0x7D;
delay_ms(500);
portc= 0x6D;
delay_ms(500);
portc= 0x66;
delay_ms(500);
portc= 0x4F;
delay_ms(500);
portc= 0x5B;
delay_ms(500);
portc= 0x06;
delay_ms(500);
portc= 0x3F;
delay_ms(500);
portc= 0x00;
}
}
|
9c25a93a5e45500d8c9e39866335bfeb8cd8873e | 00784014b1152e6bd63c68aae48a25f3894d6e85 | /CollectEmUp/Environment.h | fe57de3e8d2fc256e9e6c553cabb7165c0d656c7 | [] | no_license | wooffull/CollectEmUp | 061fe7500d5952854fdf727152cb682924a005de | a5d704d3390262d6cd7ffef88204500a65a44fbf | refs/heads/master | 2021-01-18T01:19:35.353644 | 2015-12-17T06:59:43 | 2015-12-17T06:59:43 | 41,814,790 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,198 | h | Environment.h | #pragma once
#include "GameObject.h"
#include "Random.h"
#include "ModelImporter.h"
#include "DisplayEvent.h"
#include "Camera.h"
#include "KeyboardMovableGO.h"
#include "OctTree.h"
#include "ExamplePrefabClass.h"
#include "BlockPlatform.h"
#include "Level1.h"
class Environment :
public GameObject
{
public:
Environment();
virtual ~Environment();
virtual void update( float dt );
virtual void draw( float dt );
virtual void addChild( GameObject* child );
void turnCamera( float dx, float dy );
void moveCamera( float dx, float dy, float dz );
void movePlayer( glm::vec3 delta );
void applyGravity();
void applyDrag();
void onRemoved( Event e );
void onAdded( Event e );
private:
static const glm::vec3& GRAVITY;
static const float& DRAG;
static const float& FRICTION;
static const float& DEFLECT_PERCENTAGE;
Level1* _lvl1;
glm::mat4 _worldMatrix;
Camera _camera;
OctTree* _octTree;
KeyboardMovableGO* _player;
GameObject* _skyBox;
GameObject* _winPanel;
GameObject* _obstacle;
float _timeElapsed;
// Should be handled by something like a FollowingCamera
float _turnAmount;
};
|
687418e99a492c35b7b92e3e448ad5b25d6fb60a | d74b23408aa0b05ee82ac51f7ad2d26cb4795e01 | /dteano/biasedconvolutionnnlayer.h | 1626aa5f70c9b9fcf9a8275b0e4a7e7df4ac73dd | [
"MIT"
] | permissive | DeanoC/ViZDoom | 0dc187a15751b4704b866c2db27bd251c97de8a3 | c6991d0ff618a50e1a4a539f40044eb89815e195 | refs/heads/master | 2021-01-14T08:36:35.756799 | 2016-04-30T06:02:26 | 2016-04-30T06:02:26 | 57,125,831 | 0 | 0 | null | 2016-04-26T12:20:28 | 2016-04-26T12:20:28 | null | UTF-8 | C++ | false | false | 2,474 | h | biasedconvolutionnnlayer.h | //
// Created by deano on 27/04/16.
//
#pragma once
#ifndef VIZDOOM_BIASEDCONVOLUTIONNNLAYER_H
#define VIZDOOM_BIASEDCONVOLUTIONNNLAYER_H
#include <vector>
#include "cudacontext.h"
#include "neurallayer.h"
class BiasedConvolutionNNLayer : public NeuralLayer {
public:
BiasedConvolutionNNLayer( CudaContext::ptr _context,
int _inputWidth, int _inputHeight, int _inputChannels,
int _outputChannels, int _kernelSize, int _batchSize );
~BiasedConvolutionNNLayer();
void forwardPropogate( half_or_float const alpha, half_or_float const beta, half_or_float const *const x,
half_or_float *y ) override;
void backPropogate( half_or_float const alpha, half_or_float const beta, half_or_float const *const x,
half_or_float *y ) override;
size_t getInputCount() const override { return inputChannels * inputHeight * inputWidth; }
size_t getWeightCount() const override { return weights.size(); }
size_t getOutputCount() const override { return outputChannels; }
void setWeights( half_or_float const *const in ) override;
bool hasBias() override { return true; }
void setBiasWeights( half_or_float const *const in ) override;
int getKernelSize() const { return kernelSize; }
int getInputChannels() const { return inputChannels; }
int getInputWidth() const { return inputWidth; }
int getInputHeight() const { return inputHeight; }
int getOutputWidth() const { return outputWidth; }
int getOutputHeight() const { return outputHeight; }
int getOutputChannels() const { return outputChannels; }
int getBatchSize() const { return batchSize; }
protected:
const int kernelSize;
const int inputChannels;
const int inputWidth;
const int inputHeight;
const int outputWidth;
const int outputHeight;
const int outputChannels;
int batchSize;
std::vector< half_or_float > weights;
std::vector< half_or_float > biasWeights;
CudaContext::ptr ctx;
cudnnTensorDescriptor_t inputTensorDescriptor;
cudnnTensorDescriptor_t outputTensorDescriptor;
cudnnTensorDescriptor_t biasTensorDescriptor;
cudnnFilterDescriptor_t filterDescriptor;
cudnnConvolutionDescriptor_t forwardConvolutionDescriptor;
cudnnConvolutionFwdAlgo_t forwardConvolutionAlgorithm;
size_t forwardWorkspaceSize;
};
#endif //VIZDOOM_BIASEDCONVOLUTIONNNLAYER_H
|
e59287ac2fe7f15b4c4600d5f2efa045b4e9cc97 | 8c1e35893d8142a08ab94d33be8937c544974f05 | /test_console/test_console.cpp | bc1b64ec63533e6db26687331f5aa9bf6dbf15c6 | [] | no_license | sangyobe/playground | f5b679ad7ed53337783fd5f65cf4ec4789adf167 | 9a4fb0c81a800659712b3b96175300888718ebab | refs/heads/master | 2023-08-17T07:03:10.252635 | 2023-07-04T08:47:51 | 2023-07-04T08:47:51 | 50,490,893 | 0 | 0 | null | 2016-01-27T07:51:08 | 2016-01-27T07:46:43 | null | UTF-8 | C++ | false | false | 1,614 | cpp | test_console.cpp | #include <stdio.h>
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
#define ANSI_COLOR_BLUE "\x1b[34m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_CYAN "\x1b[36m"
#define ANSI_COLOR_RESET "\x1b[0m"
#define ANSI_BGCOLOR_RED "\x1b[41m"
#define ANSI_BGCOLOR_GREEN "\x1b[42m"
#define ANSI_BGCOLOR_YELLOW "\x1b[43m"
#define ANSI_BGCOLOR_BLUE "\x1b[44m"
#define ANSI_BGCOLOR_MAGENTA "\x1b[45m"
#define ANSI_BGCOLOR_CYAN "\x1b[46m"
int main() {
printf(ANSI_COLOR_RED "This text is RED!" ANSI_COLOR_RESET "\n");
printf(ANSI_COLOR_GREEN "This text is GREEN!" ANSI_COLOR_RESET "\n");
printf(ANSI_COLOR_YELLOW "This text is YELLOW!" ANSI_COLOR_RESET "\n");
printf(ANSI_COLOR_BLUE "This text is BLUE!" ANSI_COLOR_RESET "\n");
printf(ANSI_COLOR_MAGENTA "This text is MAGENTA!" ANSI_COLOR_RESET "\n");
printf(ANSI_COLOR_CYAN "This text is CYAN!" ANSI_COLOR_RESET "\n");
printf(ANSI_BGCOLOR_RED "This background color is RED!" ANSI_COLOR_RESET
"\n");
printf(ANSI_BGCOLOR_GREEN "This background color is GREEN!" ANSI_COLOR_RESET
"\n");
printf(ANSI_BGCOLOR_YELLOW "This background color is YELLOW!" ANSI_COLOR_RESET
"\n");
printf(ANSI_BGCOLOR_BLUE "This background color is BLUE!" ANSI_COLOR_RESET
"\n");
printf(ANSI_BGCOLOR_MAGENTA
"This background color is MAGENTA!" ANSI_COLOR_RESET "\n");
printf(ANSI_BGCOLOR_CYAN "This background color is CYAN!" ANSI_COLOR_RESET
"\n");
return 0;
} |
df1e66d26d1872f5a8457954668cc0f780bf7067 | 2a96759677afd729b22f60a1f8d83d6d434c6552 | /build-crossfit-Desktop_Qt_5_5_0_MinGW_32bit-Debug/ui_journal.h | bbd783583e5075691d8e6f87906e01aff3be9748 | [] | no_license | BSUIR350531/piskarev | 834ce42761e0e8b45c24e592de2163fdaeeffa8d | 22692e28fedf7ac309a2518cff72c1b4cd9a1ee8 | refs/heads/master | 2016-09-06T15:10:03.017235 | 2015-12-23T19:52:05 | 2015-12-23T19:52:05 | 42,023,137 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,228 | h | ui_journal.h | /********************************************************************************
** Form generated from reading UI file 'journal.ui'
**
** Created by: Qt User Interface Compiler version 5.5.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_JOURNAL_H
#define UI_JOURNAL_H
#include <QtCore/QLocale>
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QCalendarWidget>
#include <QtWidgets/QCommandLinkButton>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QTextEdit>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_Journal
{
public:
QTextEdit *textEdit;
QCalendarWidget *calendarWidget;
QCommandLinkButton *QuitButton;
void setupUi(QWidget *Journal)
{
if (Journal->objectName().isEmpty())
Journal->setObjectName(QStringLiteral("Journal"));
Journal->resize(800, 600);
textEdit = new QTextEdit(Journal);
textEdit->setObjectName(QStringLiteral("textEdit"));
textEdit->setGeometry(QRect(0, 0, 401, 601));
textEdit->setLocale(QLocale(QLocale::English, QLocale::UnitedStates));
calendarWidget = new QCalendarWidget(Journal);
calendarWidget->setObjectName(QStringLiteral("calendarWidget"));
calendarWidget->setGeometry(QRect(470, 0, 321, 221));
calendarWidget->setLocale(QLocale(QLocale::English, QLocale::UnitedStates));
QuitButton = new QCommandLinkButton(Journal);
QuitButton->setObjectName(QStringLiteral("QuitButton"));
QuitButton->setGeometry(QRect(510, 430, 291, 41));
retranslateUi(Journal);
QMetaObject::connectSlotsByName(Journal);
} // setupUi
void retranslateUi(QWidget *Journal)
{
Journal->setWindowTitle(QApplication::translate("Journal", "Form", 0));
QuitButton->setText(QApplication::translate("Journal", " Back to Main Menu", 0));
} // retranslateUi
};
namespace Ui {
class Journal: public Ui_Journal {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_JOURNAL_H
|
df5699818b15f4ccf7262f42aaf5dc40365934de | 258c2ddbf212d5bf0da8d88743d360421773cf3b | /TestFramework/TCPFunc.cpp | a8051e9d83650dfdfe614a466ce7b34c81a3a6ca | [] | no_license | whymeen/TestFramework | a4ea96043f6f22657d4b976027bf0a4dce77c6cf | 25d5ea46637d49d9a9ea918b04871c3f4ae3aa9a | refs/heads/master | 2020-06-29T03:35:23.189121 | 2017-01-11T09:03:34 | 2017-01-11T09:03:34 | 74,451,444 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 6,713 | cpp | TCPFunc.cpp | #include "stdafx.h"
#include "TCPFunc.h"
TCPFunc::TCPFunc()
{
m_iCurSystemCode = 1;
}
TCPFunc::~TCPFunc()
{
}
void TCPFunc::initNetwork()
{
readConfigure();
char iip[20];
sprintf(iip, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
// 네트워크 연결 생성
///////////////////////////////////////////////////////////////////
//m_pTCPServer = new CNetworkTCPServer(iip , port1);
m_pTCPServer = new CNetworkTCPServer("127.0.0.1", 5100);
m_pTCPServer->addCallback(getEventMsg, this);
//////////////////////////////////////////////////////////////////
// 메시지 관련 버퍼 초기화
initMsgBuf();
}
void TCPFunc::initMsgBuf()
{
// 메시지 관련 버퍼 초기화
////////////////////////////////////////////////////////////////////////////////
m_ichBufIndex = 0; // 받은정보중 데이터가 있는부분
m_ipreRcvSize = 0; // 다음 패킷 받을때 붙여야 할 부분
memset(&m_chBuf, 0x00, NETWORK_MAXSIZE); // 메시지 버퍼 초기화
////////////////////////////////////////////////////////////////////////////////
}
void TCPFunc::SendEventData(char* packetData, int packetDataSize)
{
char sendBuf[NETWORK_MAXSIZE];
ICD_HEADER header;
int headsize = sizeof(ICD_HEADER);
memset(&header, 0x00, sizeof(ICD_HEADER));
int totsize = headsize + packetDataSize;
header.H_Timestamp = GetTimeStamp();
header.H_Length = totsize / 4;
header.H_Sender_Equip_Code = m_iCurSystemCode;
header.H_Receiver_Equip_Code = 2;
//header.C_TImeHour = 7;
//header.C_TImeMinute = 12;
//header.C_TImeSec = 22;
//header.C_TImeMSec = 111;
memcpy(&sendBuf, (char*)&header, headsize); // 헤더 붙이기
memcpy(&sendBuf[headsize], (char*)packetData, packetDataSize); // 데이터 불이기
// dhPrint("packet size => H:%d, D:%d => total:%d, time:%d\n", headsize, packetDataSize, totsize, sizeof(header.H_Timestamp));
if (m_pTCPServer->getConnectionState() == true)
{
m_pTCPServer->sendData(sendBuf, totsize);
}
else
{
TRACE("not connect a TCP/IP, then not sending data!!\n");
}
}
void TCPFunc::SendUpdateData(char* packetData, int packetDataSize)
{
char sendBuf[NETWORK_MAXSIZE];
ICD_HEADER header;
memset(&header, 0x00, sizeof(ICD_HEADER));
int headsize = sizeof(ICD_HEADER);
int totsize = headsize + packetDataSize;
header.H_Timestamp = GetTimeStamp();
header.H_Length = totsize / 4;
header.H_Sender_Equip_Code = m_iCurSystemCode;
// header.C_TImeHour = 7;
// header.C_TImeMinute = 12;
// header.C_TImeSec = 22;
// header.C_TImeMSec = 111;
memcpy(&sendBuf, (char*)&header, headsize); // 헤더 붙이기
memcpy(&sendBuf[headsize], (char*)packetData, packetDataSize); // 데이터 불이기
// dhPrint("packet size => H:%d, D:%d => total:%d, time:%d\n", headsize, packetDataSize, totsize, sizeof(header.H_Timestamp));
if (m_pTCPServer->getConnectionState() == true)
{
m_pTCPServer->sendData(sendBuf, totsize);
}
else
{
TRACE("not connect a TCP/IP, then not sending data!!\n");
}
}
void TCPFunc::getEventMsg(char *msg, void *param, int dataSize)
{
TCPFunc *pMF = (TCPFunc *)param;
int bufIndex = 0;
double dTimeStamp = 0;
int iLength = 0;
int type = -1;
int length = -1;
//////////////////////////////////////////////////////////////////////////
// 임시 버퍼에 저장
memcpy(&pMF->m_chBuf[pMF->m_ichBufIndex], &msg[bufIndex], dataSize);
dataSize += pMF->m_ichBufIndex;
//////////////////////////////////////////////////////////////////////////
if (pMF->m_ichBufIndex != 0)
{
pMF->m_ichBufIndex = 0;
pMF->m_ipreRcvSize = 0;
}
while ((bufIndex + 1) < dataSize)
{
ICD_HEADER header;
memcpy(&header, &msg[bufIndex], sizeof(ICD_HEADER));
dTimeStamp = header.H_Timestamp;
iLength = header.H_Length;
// 패킷 분석 완료여부 판단
/////////////////////////////////////////////////////////////
if (iLength > (dataSize - bufIndex))
{
pMF->initMsgBuf();
pMF->m_ichBufIndex = dataSize - bufIndex; // 받은정보중 데이터가 있는부분
pMF->m_ipreRcvSize = iLength - pMF->m_ichBufIndex; // 다음 패킷 받을때 붙여야 할 부분
memcpy(&pMF->m_chBuf[0], &msg[bufIndex], pMF->m_ichBufIndex);
//TRACE("receive event message 신호이어 붙이기 : m_ichBufIndex[%d] m_ipreRcvSize[%d]\n", m_ichBufIndex, m_ipreRcvSize);
break;
}
/////////////////////////////////////////////////////////////
bufIndex += sizeof(ICD_HEADER);
unsigned char c, l;
memcpy(&c, &msg[bufIndex], 1);
memcpy(&l, &msg[bufIndex + 1], 1);
type = c;
length = l;
TRACE("evenet message 신호 수신 type:[%#x], timestamp:[%f], length:[%d] realSize[%d]\n", type, dTimeStamp, length, dataSize);
switch (type)
{
case MSG_CODE_EVENT_SIMULATION_CONTROL_0x11:
bufIndex += sizeof(EVENT_SIMULATION_CONTROL);
break;
case MSG_CODE_EVENT_OBJECT_SETUP_0x12:
bufIndex += sizeof(EVENT_OBJECT_CONTROL);
break;
case MSG_CODE_EVENT_TORPEDO_SETUP_0x13:
bufIndex += sizeof(EVENT_TORPEDO_SETUP);
break;
case MSG_CODE_EVENT_DECOY_SETUP_0x14:
bufIndex += sizeof(EVENT_DECOY_SETUP);
break;
case MSG_CODE_OBJECT_UPDATE_0x21:
{
UPDATE_OBJECT rcvData;
memset(&rcvData, 0x00, sizeof(UPDATE_OBJECT));
memcpy(&rcvData, &msg[bufIndex], sizeof(UPDATE_OBJECT));
bufIndex += sizeof(UPDATE_OBJECT);
TRACE("type:%#x, length:%d, ObjectID:%d, ObjectType:%d\n", rcvData.type, rcvData.length, rcvData.objectID, rcvData.objectType);
TRACE("x:%f, y:%f, z:%f, h:%f, p:%f, r:%f\n", rcvData.x, rcvData.y, rcvData.z, rcvData.h, rcvData.p, rcvData.r);
}
break;
default:
pMF->initMsgBuf();
TRACE("unknown message 신호 수신 type:[%#x], length:[%d]\n", type, length);
break;
}
}
}
void TCPFunc::close()
{
if (m_pTCPClient)
{
delete m_pTCPClient;
}
m_pTCPClient = NULL;
if (m_pTCPServer)
{
delete m_pTCPServer;
}
m_pTCPServer = NULL;
}
void TCPFunc::readConfigure(void)
{
FILE *fp = fopen("configb.cfg", "r");
if (fp)
{
char str[255];
int a, b, c, d;
fscanf(fp, "%s %d %d %d %d", str, &a, &b, &c, &d);
ip[0] = (unsigned char)a;
ip[1] = (unsigned char)b;
ip[2] = (unsigned char)c;
ip[3] = (unsigned char)d;
fscanf(fp, "%s %d", str, &a);
port1 = a;
fscanf(fp, "%s %d", str, &a);
port2 = a;
fclose(fp);
}
}
const double TCPFunc::GetTimeStamp()
{
SYSTEMTIME sysTime;
//GetSystemTime(&sysTime); // 국제시간 [8/5/2010 boxface]
GetLocalTime(&sysTime); // 현지 지역시간 [8/5/2010 boxface]
CString csTimeStamp;
csTimeStamp.Format("%04d%02d%02d%02d%02d%02d%03d",
sysTime.wYear, sysTime.wMonth, sysTime.wDay,
sysTime.wHour, sysTime.wMinute, sysTime.wSecond,
sysTime.wMilliseconds);
return atof(csTimeStamp);
} |
7a037efe13c1d25a37241f572540c16ecd60ce44 | b7c505dcef43c0675fd89d428e45f3c2850b124f | /Src/Representations/MotionControl/HeadJointRequest.h | 8c158c601c15daf29b40a4105b1e20cbf8dc7940 | [
"BSD-2-Clause"
] | permissive | pranet/bhuman2009fork | 14e473bd6e5d30af9f1745311d689723bfc5cfdb | 82c1bd4485ae24043aa720a3aa7cb3e605b1a329 | refs/heads/master | 2021-01-15T17:55:37.058289 | 2010-02-28T13:52:56 | 2010-02-28T13:52:56 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 857 | h | HeadJointRequest.h | /**
* @file Representations/MotionControl/HeadJointRequest.h
* This file declares a class that represents the requested head joint angles.
* @author <A href="mailto:allli@informatik.uni-bremen.de">Alexander Härtl</A>
*/
#ifndef __HeadJointRequest_H__
#define __HeadJointRequest_H__
#include "Tools/Streams/Streamable.h"
/**
* @class HeadJointRequest
* A class that represents the requested head joint angles.
*/
class HeadJointRequest : public Streamable
{
private:
virtual void serialize( In* in, Out* out)
{
STREAM_REGISTER_BEGIN();
STREAM(pan);
STREAM(tilt);
STREAM_REGISTER_FINISH();
}
public:
/**
* Default constructor.
*/
HeadJointRequest() : pan(0), tilt(0) {}
double pan, /**< Head pan target angle in radians. */
tilt; /**< Head tilt target angle in radians. */
};
#endif // __HeadJointRequest_H__
|
dc8aebd2db993571e3c7d8915630be8d072b21f3 | ab309154f0ecb5a571036b342905755c2e05cc12 | /EGX_TurretGame/Game/Private/COG/COGZergling.cpp | 1f98ddb2037bec9120c5f2dcb7cb94ce221d7a74 | [] | no_license | tdcoish/EngineXProjects | 6624ba04b788da70f00d73aa18583edb7d4faa3d | 2bfef91354fde2479c39464a5c8ebfe112b83cf9 | refs/heads/master | 2020-04-12T18:36:23.590999 | 2018-12-21T07:53:55 | 2018-12-21T07:53:55 | 162,684,463 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,399 | cpp | COGZergling.cpp |
#include "Game/Private/COG/COGZergling.h"
#include "Game/Private/COG/COGPhysics.h"
#include "Game/Private/COG/COGPlayer.h"
#include "Game\Private\COG\COGWall.h"
#include "Game\Private\COG\COGExplosion.h"
#include "COGPlasma.h"
#include "Game\Private\GOSystem\GameObjectInventory.h"
std::vector<COGZergling*> COGZergling::mZerglingComponents;
COGZergling::COGZergling(GameObject* pGO)
: Component(pGO)
{}
void COGZergling::Initialize()
{
AddToComponentVector(mZerglingComponents);
// Again, for this project I'm just having objects listen to their own collisions.
// However, I could have something like:
// mGO->FindComponent<COGPhysics>(ComponentType::Physics)->SetListener(AudioSystem::getInstance());
// mGO->FindComponent<COGPhysics>(ComponentType::Physics)->SetListener(ScoreSystem::getInstance());
// mGO->FindComponent<COGPhysics>(ComponentType::Physics)->SetListener(SomeThingElse::getInstance());
mGO->FindComponent<COGPhysics>(ComponentType::Physics)->SetListener(this);
// For now we just have it moving steadily towards the player
COGPhysics* pPhys = mGO->FindComponent<COGPhysics>(ComponentType::Physics);
pPhys->mVelocity.x = -100;
pPhys->mVelocity.y = 0;
}
void COGZergling::Destroy() {
RemoveFromComponentVector(mZerglingComponents);
}
void COGZergling::Update() {
}
void COGZergling::OnCollision(COGPhysics* pMe, COGPhysics* pOther)
{
// Use players, walls, plasmoids
COGPlayer* pPlayer = pOther->mGO->FindComponent<COGPlayer>(ComponentType::Player);
COGWall* pWall = pOther->mGO->FindComponent<COGWall>(ComponentType::Wall);
COGPlasma* pPlasma = pOther->mGO->FindComponent<COGPlasma>(ComponentType::Plasmoid);
COGExplosion* pExp = pOther->mGO->FindComponent<COGExplosion>(ComponentType::Explosion);
// destroy yourself no matter what you hit. So I guess we could just write this line here and skip everything else.
//GameObjectInventory::getInstance()->StoreGOForDeletion(this->mGO->GetHandle());
if (pWall != nullptr) {
GameObjectInventory::getInstance()->StoreGOForDeletion(this->mGO->GetHandle());
}
if (pPlayer != nullptr) {
GameObjectInventory::getInstance()->StoreGOForDeletion(this->mGO->GetHandle());
}
if (pPlasma != nullptr) {
GameObjectInventory::getInstance()->StoreGOForDeletion(this->mGO->GetHandle());
}
if (pExp != nullptr) {
GameObjectInventory::getInstance()->StoreGOForDeletion(this->mGO->GetHandle());
}
}
|
2470fed75e740e850aa18b0b24201ab7155fbb32 | 4e035c6d51fa19cbdf4f584867b55e7813b69869 | /include/Misc/SShootTargetEntry.h | e2dcabe97cfff212dfeae5935f4c5590739832cf | [] | no_license | ipoopedmypantsuups/HitmanAbsolutionSDK | d28ec117f8da8c2f1bab3068a17c7143c5f83ea4 | c4a211550dc66687df9bdae5d4c0bf665d48f5ad | refs/heads/main | 2023-03-08T05:04:24.939062 | 2021-02-20T08:07:30 | 2021-02-20T08:07:30 | 359,103,783 | 0 | 0 | null | 2021-04-18T09:50:59 | 2021-04-18T09:50:58 | null | UTF-8 | C++ | false | false | 175 | h | SShootTargetEntry.h | #pragma once
#include "float4.h"
class alignas(16) SShootTargetEntry
{
public:
float4 m_wsPosition;
int m_nBoneID;
float4 m_csPlaneOffset;
bool m_bValid;
};
|
1adf225588ec553495933b6be3f1acbd21439b20 | 5902fa0857cd4f722a9663bbd61aa0895b9f8dea | /BMIG-5101-SequencesAsBioInformation/Blast/ncbi-blast-2.10.0+-src/c++/src/objects/seqalign/Seq_align_set.cpp | 4febe25281c23f8e78a86ebc4b21cb72b23bfc38 | [] | no_license | thegrapesofwrath/spring-2020 | 1b38d45fa44fcdc78dcecfb3b221107b97ceff9c | f90fcde64d83c04e55f9b421d20f274427cbe1c8 | refs/heads/main | 2023-01-23T13:35:05.394076 | 2020-12-08T21:40:42 | 2020-12-08T21:40:42 | 319,763,280 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 129 | cpp | Seq_align_set.cpp | version https://git-lfs.github.com/spec/v1
oid sha256:b00e95a42410b8f573d38ec4caddb96abfb7a2366384f0195d88098b78d29623
size 2319
|
fa36618246642e912b78bb478b1a4359839b905b | 2ccb2893e895cae01e508f5a669c39a3a4aeaf71 | /Transform/lineartransform.h | c8223ab5ea3a9c08b136b6ab279501548a81817a | [
"Apache-2.0"
] | permissive | xubenhao/VisualAlgorithm | 513942013716fc2caddae8e1cd32318fc50a8bdc | 5fc45d9a4fc58569953fe3d880517adcd2fb0881 | refs/heads/main | 2023-02-28T19:31:51.437208 | 2021-02-08T02:29:50 | 2021-02-08T02:29:50 | 333,267,125 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 857 | h | lineartransform.h | // Author : XuBenHao
// Version : 1.0.0
// Mail : xbh370970843@163.com
// Copyright : XuBenHao 2020 - 2030
#ifndef TRANSFORM_LINEARTRANSFORM_H
#define TRANSFORM_LINEARTRANSFORM_H
#include "transform.h"
namespace NTransform
{
class LinearTransform : public Transform
{
Q_OBJECT
public:
LinearTransform(QObject* parent = nullptr);
LinearTransform(
double nOffX_,
double nOffY_,
QObject* parent = nullptr);
virtual NMatrix::Matrix GetMatrix();
virtual TRANSFORM_TYPE GetType(){return TRANSFORM_LINEAR;}
virtual Transform* DeepCopy();
virtual void PrintDebugInfo();
virtual void PrintDebugInfo(QFile& hFile_);
private:
double m_nOffX;
double m_nOffY;
};
}
#endif // LINEARTRANSFORM_H
|
340152d61afce605d6cc76d9df44bdf8207b3d8a | 68013b3e5821fdf132aa2ff12ddc6214a67ea762 | /buy.cpp | 390e8ac1387bab02bb941f2f63df4c4114953794 | [] | no_license | beench/problem-solving | e35a9617e9dc552e09a25ec6defe39ecf9092369 | 474412c6b754969d47788fa4234ab062b5376f03 | refs/heads/master | 2020-04-23T07:44:34.713014 | 2019-02-16T14:51:09 | 2019-02-16T14:51:09 | 171,014,629 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 880 | cpp | buy.cpp | #include <iostream>
#include <stdio.h>
#include <set>
using namespace std;
int main()
{
int n;
long long a, b, x;
cin >> n >> a >> b;
set<long long> price;
for (int i = 0; i < n; i++) {
cin >> x;
price.insert(x);
// if (i > 0) {
// if (price[i-1] > price[i]) {
// long long tmp = price[i-1];
// price[i-1] = price[i];
// price[i] = tmp;
// }
// }
}
if (b < a) {
int tmp = b;
b = a;
a = tmp;
}
bool isFirst = true;
int cnt = 0;
for (set<long long>::iterator i = price.begin(); i != price.end(); i++) {
for (set<long long>::iterator j = i+1; j != price.end() ; j++) {
if (*i + *j >= a && *i + *j <= b) {
cnt++;
}
}
}
cout << cnt << endl;
} |
12493a28dfaccc4cb852b508f9ccdb1dfa939fa6 | 5ed0a5cdb9df0e750f872f00ab9f16f30cf20923 | /Splash.h | 0def1b9cb7b755c3c73cf05febdb280f421bcfb0 | [] | no_license | perjlieb/gp2trackeditor | f62758fde3fa711df92972ba91777570e04cb177 | 39cefbcbf99530ccdf918e6da49b77112677f2b7 | refs/heads/master | 2022-04-13T17:49:29.725626 | 2020-03-21T12:56:41 | 2020-03-21T12:57:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,234 | h | Splash.h | // CG: This file was added by the Splash Screen component.
#ifndef _SPLASH_SCRN_
#define _SPLASH_SCRN_
// Splash.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// Splash Screen class
class CSplashWnd : public CWnd
{
// Construction
protected:
CSplashWnd();
// Attributes:
public:
CBitmap m_bitmap;
// Operations
public:
static void
EnableSplashScreen(BOOL bEnable = TRUE);
static void
ShowSplashScreen(CWnd* pParentWnd = NULL);
static BOOL
PreTranslateAppMessage(MSG* pMsg);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSplashWnd)
//}}AFX_VIRTUAL
// Implementation
public:
~CSplashWnd();
virtual void
PostNcDestroy();
protected:
BOOL
Create(CWnd* pParentWnd = NULL);
void
HideSplashScreen();
static BOOL c_bShowSplashWnd;
static CSplashWnd* c_pSplashWnd;
// Generated message map functions
protected:
//{{AFX_MSG(CSplashWnd)
afx_msg int
OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void
OnPaint();
afx_msg void
OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif
|
01ee69b05f1776cc5b754d3ebf3f78595272471c | b062ffdf852f60c7126c507613af2d47f3938ffe | /AdvancedCPP/ArrayBasedList/ArrayBasedList/UnsortedType.cpp | c877b98ddc8f596edadfb51d385871da3ab9f940 | [] | no_license | Vardominator/Miscellaneous | f297cb9d481d0178d52c600a402eb2018c0434fc | e4a207e273a3576cd0a4eef7f8c4a556a2794d5f | refs/heads/master | 2020-05-21T22:17:14.346103 | 2017-04-05T08:06:29 | 2017-04-05T08:06:29 | 60,390,970 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 797 | cpp | UnsortedType.cpp | #include "UnsortedType.h"
#include <iostream>
UnsortedType::UnsortedType()
{
length = 0;
}
// O(1)
void UnsortedType::InsertItem(int item)
{
if (IsFull())
{
return;
}
info[length] = item;
length++;
}
// O(1)
bool UnsortedType::IsFull() const
{
return (length == 10);
}
// O(1)
void UnsortedType::MakeEmpty()
{
// If it's empty to the user, then it is empty.
length = 0;
}
// O(n)
void UnsortedType::DeleteItem(int item)
{
for (int i = 0; i < length; i++)
{
if (info[i] == item)
{
// Move the last element into the spot of the deleted item
info[i] = info[length - 1];
length--;
}
}
}
// O(n)
void UnsortedType::Show()
{
for (int i = 0; i < length; i++)
{
std::cout << info[i] << " " << std::endl;
}
}
int UnsortedType::GetLength() const
{
return length;
} |
f28c67f4fe941c0fd448953589922830ab8e400d | 908ac2f92341d4eaed43b13dba2f43244c2328e1 | /Design/w4rd3n/2/2.cpp | b1f384a0da54a934a9bfad1cd2a530e831f393cd | [] | no_license | 5l1v3r1/2018-NUAA-Data-Structrue-Experiments-design | bffbedfb504e8af309f5af91cac1591366cf89c6 | 20cd509353a0e1013bf2dac447016f8accc271fd | refs/heads/master | 2021-03-20T13:56:48.589903 | 2019-01-11T06:44:34 | 2019-01-11T06:44:34 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,678 | cpp | 2.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int N,K,w,s,c;
int key[100001];
typedef struct Action
{
int num;
int time;
int flag;
}action;
//保存借钥匙和还钥匙两个动作,flag为0表示借,flag为1表示还
vector<action> a;
action temp;
bool cmp(action a,action b){
if(a.time != b.time)
//先按时间排
{
return a.time < b.time;
}
else if(a.flag != b.flag)
//先还再借
{
return a.flag > b.flag;
}
else
//编号从小到大
{
return a.num < b.num;
}
}
//用于比较的函数
int main()
{
cin >> N >> K;
for(int i = 1;i <= N;i++)
{
key[i]=i;
}
//初始化钥匙的位置
while(K--)
{
cin >> w >> s >> c;
temp.num = w;
temp.time = s;
temp.flag = 0;
a.push_back(temp);
//借钥匙
temp.num = w;
temp.time = s + c;
temp.flag = 1;
a.push_back(temp);
//还钥匙
}
sort(a.begin(),a.end(),cmp);
//排序
for(int i = 0;i < a.size();i++)
{
if(a[i].flag == 1)
//还钥匙
{
for(int k = 1;k <= N;k++)
{
if(key[k] == 0)
{
key[k] = a[i].num;
break;
}
}
}
else
//借钥匙
{
for(int j = 1;j <= N;j++)
{
if(key[j] == a[i].num)
{
key[j] = 0;
break;
}
}
}
}
for(int i = 1;i <= N;i++)
{
cout << key[i] <<" ";
}
return 0;
}
|
7808e9b0e8a359daae985ff2c21c54d2f2be67a2 | 7536f5d95e5094b20d360a3a6427acbb2c1cd368 | /gui/statBarWithSolution.cpp | 8f5cd53d1cf8eb89ce19168493404f8e056372a5 | [] | no_license | ebadusb/Trima_12.4 | 6804354151afd5d70014ccea3ced73b054cd2eea | 8e3d59f14f30b1b5bd1c3696703c2a024c2e4c5f | refs/heads/master | 2022-11-12T19:30:35.576215 | 2019-08-19T19:16:23 | 2019-08-19T19:16:23 | 274,995,217 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,406 | cpp | statBarWithSolution.cpp | /************************> FOCUSSED GUI DOMAIN <****************************
* Copyright(c) 2009 CaridianBCT, Inc. All rights reserved
* Author: Dan Slauson
* Class name: StatBarBase
* File name: statBarBase.cpp
* Contents: Implementations of class methods
* Description: See descriptions in corresponding .hpp file.
*************************< FOCUSSED GUI DOMAIN >***************************/
#include <vxworks.h>
#include "aphwind.hpp"
#include "guiglobs.hpp"
#include "statBarWithSolution.hpp"
StatBarWithSolution::StatBarWithSolution()
: StatBarBase(STATUS_BAR_TYPE_WITH_ADDITION,
textProgBarLoad,
textProgBarDonorInfo,
textProgBarDonorPrep,
textProgBarDonate,
textProgBarAddition,
textProgBarUnload)
{
statBarGraphics["CCCCCC"] = BITMAP_STATUS_WITH_SOL_CCCCCC;
statBarGraphics["CGCCCC"] = BITMAP_STATUS_WITH_SOL_CGCCCC;
statBarGraphics["CYCCCC"] = BITMAP_STATUS_WITH_SOL_CYCCCC;
statBarGraphics["GCCCCC"] = BITMAP_STATUS_WITH_SOL_GCCCCC;
statBarGraphics["GGCCCC"] = BITMAP_STATUS_WITH_SOL_GGCCCC;
statBarGraphics["GGGGCC"] = BITMAP_STATUS_WITH_SOL_GGGGCC;
statBarGraphics["GGGGGG"] = BITMAP_STATUS_WITH_SOL_GGGGGG;
statBarGraphics["GGGGGY"] = BITMAP_STATUS_WITH_SOL_GGGGGY;
statBarGraphics["GGGGYC"] = BITMAP_STATUS_WITH_SOL_GGGGYC;
statBarGraphics["GGGYCC"] = BITMAP_STATUS_WITH_SOL_GGGYCC;
statBarGraphics["GGYCCC"] = BITMAP_STATUS_WITH_SOL_GGYCCC;
statBarGraphics["GYCCCC"] = BITMAP_STATUS_WITH_SOL_GYCCCC;
statBarGraphics["YCCCCC"] = BITMAP_STATUS_WITH_SOL_YCCCCC;
statBarGraphics["YGCCCC"] = BITMAP_STATUS_WITH_SOL_YGCCCC;
}
string StatBarWithSolution::getStatusString ()
{
char statusString[7] = "" ;
// Build the status pattern based on the contents of the _currentPhase
sprintf(statusString, "%c%c%c%c%c%c",
convert_status_to_strchar(_currentPhase.status_load),
convert_status_to_strchar(_currentPhase.status_info),
convert_status_to_strchar(_currentPhase.status_prepare),
convert_status_to_strchar(_currentPhase.status_donate),
convert_status_to_strchar(_currentPhase.status_solutions),
convert_status_to_strchar(_currentPhase.status_unload));
return statusString;
}
/* FORMAT HASH 74afbf3569f7fc13b49d82c1b1faafb0 */
|
bf3454622262e85e1e4828a4684b2174ac686742 | a4d5ab8b22d2f76dae1e5af4581d4c579d93ef60 | /persona.hpp | da0010044a8c4bb04293a424d7dca162cc511742 | [] | no_license | Xabras123/EDD | 038c74ad23626dc639a7b8c98e3f13cb46535b7f | 90dd98ca46cc0cb631e9dc80e8bc3e37536b89d6 | refs/heads/master | 2021-01-24T16:19:22.254852 | 2018-02-27T16:52:26 | 2018-02-27T16:52:26 | 123,183,071 | 0 | 0 | null | 2018-02-27T20:17:44 | 2018-02-27T20:17:43 | null | UTF-8 | C++ | false | false | 855 | hpp | persona.hpp | #ifndef __PERSONA__HPP__
#define __PERSONA__HPP__
#include <iostream>
#include "persona.h"
#include <string>
#include <list>
using namespace std;
void Persona::setCodigo(string codigoIn){
codigo = codigoIn;
}
void Persona::setNombreYApellido(string nombreIn){
nombreYApellido = nombreIn;
}
void Persona::setDireccion(string direccionIn){
direccion = direccionIn;
}
void Persona::setCiudad(string ciudadIn){
ciudad = ciudadIn;
}
void Persona::setTelefono( string telefonoIn){
telefono = telefonoIn;
}
string Persona::getCodigo( ){
return codigo;
}
string Persona::getNombreYApellido( ){
return nombreYApellido;
}
string Persona::getDireccion( ){
return direccion;
}
string Persona::getCiudad( ){
return ciudad;
}
string Persona::getTelefono (){
return telefono;
}
#endif
|
af7fab337a55b8e389716507130afe7d9f6600c4 | 96378ce241101351443b7ff91ac6eab84dc49632 | /HardWorker/AreaSelect.h | c3bb07d08b5d6dfd62b784ac7f1df5546dd4c8c0 | [] | no_license | beatheat/HardWorker | 3b123f29bc2544419a5ad127ca68b1b65f2b6c3f | 550d4b6909ba76c0e7c1c3ec744f21e688159ab8 | refs/heads/master | 2022-07-31T08:31:52.426674 | 2018-06-17T23:20:28 | 2018-06-17T23:20:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 261 | h | AreaSelect.h | #pragma once
#include "Gasolinn.h"
class AreaSelect : public Object
{
public:
Texture *tMap;
Texture *Rect;
ExtraData *data;
bool rectOn[5];
public:
void Initialize() override;
void Step() override;
void Draw() override;
void Destroy() override;
}; |
5f3901be5855e3a712be126d38b69f1e6b5606e6 | af3d4e771df8fa1861a8b19e4e199ffdff6641d4 | /dll/dynamic_load_win32/main.cpp | 7c82bba99982f4378301b09ab00bfa35838f702c | [] | no_license | popany/cpp_demos | 7718a5782ca2276f35fda2543971a6f06d5db6dd | 73cb7cc9cb146a4956d9bc75ceb24b20f66bc138 | refs/heads/master | 2020-12-08T11:30:38.821471 | 2020-06-11T01:54:00 | 2020-06-11T01:54:00 | 232,971,003 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 749 | cpp | main.cpp | #include <string>
#include <iostream>
#include <windows.h>
#include "foo_api.h"
typedef FooApi* __stdcall CreateFooApiFunc();
class MyFooSpi : public FooSpi
{
std::string name;
public:
MyFooSpi()
{
}
void SetName(const std::string& name)
{
this->name = name;
}
std::string GetName() override
{
return this->name;
}
};
void Run()
{
HINSTANCE fooApiDll = LoadLibraryA("../../foo_api/Debug/foo_api.dll");
CreateFooApiFunc* CreateFooApi = (CreateFooApiFunc*)GetProcAddress(fooApiDll, "CreateFooApi");
FooApi* fooApi = CreateFooApi();
MyFooSpi fooSpi;
fooSpi.SetName("123");
fooApi->RegisterSpi(&fooSpi);
fooApi->PrintName();
delete fooApi;
}
int main()
{
Run();
return 0;
} |
c1de6c3205267d3c7f4491b8e89b63ca791a4e9d | 39927c96998068cb9c722150e7d4bd2badd7de71 | /src/window/win32/WGLContext.h | 071de6b49c7afbbfb2fd358180e67d9d76e35be5 | [] | no_license | haopanda/LXBM | 71807a07441659f1167e6ba0dd42958a81f9cd90 | e1aa02f9cd1014b5be18e4f6ac18ce638e81fad8 | refs/heads/master | 2021-01-02T08:16:25.234399 | 2017-08-04T02:21:05 | 2017-08-04T02:21:05 | 98,981,666 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,937 | h | WGLContext.h | #ifndef _WGL_CONTEXT_H_
#define _WGL_CONTEXT_H_
#include "window/GLContext.h"
#include <windows.h>
class GLWindowWin32;
class WGLContext : public GLContext
{
public:
static WGLContext* create(GLWindowWin32* window);
static bool initWGLExtension(HWND handler);
// 实现父类方法
virtual bool makeCurrent(void);
virtual void swapBuffers(void);
private:
bool init(GLWindowWin32* window);
int getPixelFormatAttrib(int pixelFormat, int attrib);
int choosePixelFormat(GLWindowWin32* window, const FBConfig& fbConfig);
private:
HDC _hDC;
HGLRC _hRC;
//////////////////////////////////////////////////////////////////////////
typedef BOOL(WINAPI * PFNWGLSWAPINTERVALEXTPROC)(int);
typedef BOOL(WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC)(HDC, int, int, UINT, const int*, int*);
typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC)(void);
typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC);
typedef HGLRC(WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC, HGLRC, const int*);
typedef HGLRC(WINAPI * PFN_wglCreateContext)(HDC);
typedef BOOL(WINAPI * PFN_wglDeleteContext)(HGLRC);
typedef PROC(WINAPI * PFN_wglGetProcAddress)(LPCSTR);
typedef HDC(WINAPI * PFN_wglGetCurrentDC)(void);
typedef BOOL(WINAPI * PFN_wglMakeCurrent)(HDC, HGLRC);
typedef BOOL(WINAPI * PFN_wglShareLists)(HGLRC, HGLRC);
struct WGLLibrary
{
HINSTANCE instance;
PFN_wglCreateContext CreateContext;
PFN_wglDeleteContext DeleteContext;
PFN_wglGetProcAddress GetProcAddress;
PFN_wglGetCurrentDC GetCurrentDC;
PFN_wglMakeCurrent MakeCurrent;
PFN_wglShareLists ShareLists;
PFNWGLSWAPINTERVALEXTPROC SwapIntervalEXT;
PFNWGLGETPIXELFORMATATTRIBIVARBPROC GetPixelFormatAttribivARB;
PFNWGLGETEXTENSIONSSTRINGEXTPROC GetExtensionsStringEXT;
PFNWGLGETEXTENSIONSSTRINGARBPROC GetExtensionsStringARB;
PFNWGLCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
bool EXT_swap_control;
bool EXT_colorspace;
bool ARB_multisample;
bool ARB_framebuffer_sRGB;
bool EXT_framebuffer_sRGB;
bool ARB_pixel_format;
bool ARB_create_context;
bool ARB_create_context_profile;
bool EXT_create_context_es2_profile;
bool ARB_create_context_robustness;
bool ARB_create_context_no_error;
bool ARB_context_flush_control;
};
static WGLLibrary* s_wglLibrary;
static bool initWGLLibrary(HDC hDC);
//////////////////////////////////////////////////////////////////////////
};
#endif // !_WGL_CONTEXT_H_
|
8055075f07b5cca9c89c59ff593e2e77f0b5af8b | 146ed375ceecf39edb074e7b76801148a990b3f0 | /GeoTreeT.cc | 459c1e4f415c42088561845384303b1562f35560 | [] | no_license | elliott-omosheye/meshmixer | a9f6a20f9a330f1c1d66d982e8d44dfada373f65 | aeff1250f36dfa62eca7da42fbcf6027fd4d25e9 | refs/heads/master | 2021-01-17T18:29:40.678422 | 2014-04-23T19:28:47 | 2014-04-23T19:28:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,512 | cc | GeoTreeT.cc | #ifndef GEOTREE_CC
#define GEOTREE_CC
#include "GeoTreeT.hh"
#include <stdlib.h>
#include "FacePriorityT.hh"
template <typename M>
GeoTreeT<M>::GeoTreeT(M *m, int k)
{
mesh = m;
noPatches = k;
std::cout << "GeoTree Init" << "\n";
QColor modelColor(255, 0, 0);
mesh->request_face_colors();
mesh->request_vertex_colors();
initPatches();
for(int i = 0; i<noPatches; i++)
{
std::priority_queue<FacePriorityT<M>*, std::vector<FacePriorityT<M>* >, FacePriorityCompareT<M> > queue;
priorityQueues[i] = queue;
}
std::cout << "Seeds Chosen" << "\n";
createPatches();
updatePatchColours();
}
template <typename M>
void
GeoTreeT<M>::initPatches()
{
std::vector<int> initSeeds;
for(int i = 0; i<noPatches; i++)
{
bool notUnique = true;
while(notUnique)
{
int seed = rand() % mesh->n_faces();
if(std::find(initSeeds.begin(), initSeeds.end(), seed) == initSeeds.end()) {
typename M::FaceHandle face = mesh->face_handle(seed);
Vec centroid = getFaceCentroid(face);
Vec normal = Vec(mesh->normal(face)[0], mesh->normal(face)[1], mesh->normal(face)[2]);
patches.push_back(new PatchT<M>(centroid, normal, seed));
notUnique = false;
}
}
//std::cout << "No. Faces on patch " << i << " - " << patches[i]->faceHandles.size() << "\n";
//std::cout << "No. Vertices on patch " << i << " - " << patches[i]->verticies.size() << "\n";
}
}
template <typename M>
Vec
GeoTreeT<M>::getFaceCentroid(typename M::FaceHandle fh)
{
Vec centroid = Vec(0,0,0);
for (typename M::FaceVertexIter vf_it=mesh->fv_iter(fh); vf_it; ++vf_it)
{
centroid = centroid + Vec(mesh->point(*vf_it)[0], mesh->point(*vf_it)[1], mesh->point(*vf_it)[2]);
}
return centroid / 3;
}
template <typename M>
void
GeoTreeT<M>::updatePatchColours()
{
for(int i = 0; i<noPatches; i++)
{
//std::cout << i << "\n";
for(int j = 0; j < patches[i]->faceHandles.size(); j++)
{
//std::cout << j << "\n";
typename M::FaceHandle face = mesh->face_handle(patches[i]->faceHandles[j]);
QColor modelColor = patches[i]->patchColour;
mesh->set_color(face, OpenMesh::Vec3f(modelColor.redF(), modelColor.blueF(), modelColor.greenF()));
}
}
}
template <typename M>
void
GeoTreeT<M>::updatePriorityQueues()
{
for(int i = 0; i<noPatches; i++)
{
for (int f_it = 0; f_it < mesh->n_faces(); f_it++)
{
typename M::FaceHandle face = mesh->face_handle(f_it);
Vec centroid = getFaceCentroid(face);
Vec normal = Vec(mesh->normal(face)[0], mesh->normal(face)[1], mesh->normal(face)[2]);
float dist = (centroid - patches[i]->centroid).norm();
float dot = normal.dot(patches[i]->normal);
normal.normalize();
patches[i]->normal.normalize();
float normDist = (normal - patches[i]->normal).norm() / 10.0f;
std::cout << "Normal Dist " << normDist << "\n";
std::cout << "Eucld Dist " << dist << "\n";
//float normAngle = dot / prodNorms;
//normAngle = sqrt(normAngle * normAngle);
//This might not be right but I think parallel vectors will have
//a value of 1 and the others will be 1.
//float paraDist;
//std::cout << normAngle << "\n";
float cost = (dist); //+ normDist; //+ (1 - normAngle);// + (normAngle);
FacePriorityT<M>* fp = new FacePriorityT<M>(cost, f_it);
priorityQueues[i].push(fp);
}
std::cout << "PriorityQueue " << i << " size after created " << priorityQueues[i].size() << "\n";
}
}
template <typename M>
void
GeoTreeT<M>::createPatches()
{
std::cout << "No Verticies on Mesh " << mesh->n_vertices() << "\n";
std::cout << "No faces on Mesh " << mesh->n_faces() << "\n";
bool notConverged = true;
double diff = 100.0;
while(notConverged)
{
PointMatrix oldCentroids = getCentroids();
clearPatches();
updatePriorityQueues();
std::cout << "Priority Queues Done" << "\n";
assignFaces();
std::cout << "Assign Faces Done" << "\n";
updateCentroids();
std::cout << "Update Centroids Done" << "\n";
double newDiff = convergenceTest(oldCentroids);
std::cout << "Difference " << newDiff << "\n";
if(newDiff > diff || newDiff < 0.001)
notConverged = false;
else
diff = newDiff;
}
}
template <typename M>
PointMatrix
GeoTreeT<M>::getCentroids()
{
PointMatrix centroids(noPatches, 3);
for(int i = 0; i<noPatches; i++)
{
centroids.row(i) = patches[i]->centroid;
}
return centroids;
}
template <typename M>
double
GeoTreeT<M>::convergenceTest(PointMatrix old)
{
PointMatrix n = getCentroids();
return (n - old).norm();
}
template <typename M>
void
GeoTreeT<M>::clearPatches()
{
for(int i = 0; i<noPatches; i++)
{
patches[i]->clear();
}
}
template <typename M>
void
GeoTreeT<M>::assignFaces()
{
std::vector<int> assignedFaces;
bool allFacesAssigned = false;
while(!allFacesAssigned)
{
for(int i = 0; i<noPatches; i++)
{
bool itemTaken = false;
while(!itemTaken)
{
if(priorityQueues[i].empty())
{
itemTaken = true;
}
else
{
FacePriorityT<M>* fp = priorityQueues[i].top();
// if face isn't already assigned
if(std::find(assignedFaces.begin(), assignedFaces.end(), fp->faceId) == assignedFaces.end())
{
// std::cout << "Face assigned" << "\n";
patches[i]->addFaceHandle(fp->faceId);
assignedFaces.push_back(fp->faceId);
typename M::FaceHandle face = mesh->face_handle(fp->faceId);
for (typename M::FaceVertexIter vf_it=mesh->fv_iter(face); vf_it; ++vf_it)
{
patches[i]->addVertex(Vec(mesh->point(*vf_it)[0], mesh->point(*vf_it)[1], mesh->point(*vf_it)[2]));
}
itemTaken = true;
}
priorityQueues[i].pop();
}
}
}
allFacesAssigned = assignedFaces.size() >= mesh->n_faces();
}
for(int i = 0; i<noPatches; i++)
{
std::cout << "PriorityQueue " << i << " size after faces assigned " << priorityQueues[i].size() << "\n";
std::cout << "Patch " << i << " no. face handles " << patches[i]->faceHandles.size() << "\n";
std::cout << "Patch " << i << " no. verticies " << patches[i]->verticies.size() << "\n";
}
}
template <typename M>
void
GeoTreeT<M>::updateCentroids()
{
for(int i = 0; i<noPatches; i++)
{
patches[i]->updateCentroid();
patches[i]->updateNormal();
}
}
#endif
|
34b08bd39abb5c00c5a062c88208f85dc802267d | 9a5bdfa8f62186eddf0bbaef65481115703628c7 | /genplugouts/Xmi2Generator/UmlChoicePseudoState.h | 14f42e3e07481b0f17b8ff5f3e81facba48c582b | [] | no_license | Zeks/douml | 95c9c741d57313439d70259ce0bbc6f1f902213b | e834d1f649687e2f197e4f25faf8cf8565cf695c | refs/heads/master | 2021-01-18T04:04:19.868031 | 2013-10-30T16:29:52 | 2013-10-30T16:29:52 | 3,631,110 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 368 | h | UmlChoicePseudoState.h | #ifndef _UMLCHOICEPSEUDOSTATE_H
#define _UMLCHOICEPSEUDOSTATE_H
#include "UmlBaseChoicePseudoState.h"
class UmlChoicePseudoState : public UmlBaseChoicePseudoState
{
public:
// the constructor, do not call it yourself !!!!!!!!!!
UmlChoicePseudoState(void * id) : UmlBaseChoicePseudoState(id, "") {
}
virtual const char * sKind() const;
};
#endif
|
42f958276521a55ab3f1b4b796a37ba6992206ff | 312b824b9aac66ab448a172c6defa34c293ea5c3 | /src/GroundGen.cpp | 61d9667a109f709841a16c485582a4b3dbe6808f | [] | no_license | SJCRPV/WorldGen | a7474a07d870af580e9610d5404ef86eb25c9ae1 | 349ff916bac34aeee459c98bacf619f0d2880379 | refs/heads/master | 2021-01-25T00:56:05.625523 | 2018-12-15T23:23:24 | 2018-12-15T23:23:24 | 94,698,837 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 122 | cpp | GroundGen.cpp | //#include "GroundGen.h"
//GroundGen::GroundGen()
//{
// //ctor
//}
//
//GroundGen::~GroundGen()
//{
// //dtor
//}
|
aca7d5cf25f3b642e9270a2f3102050546d0fcad | 2600f5489c9310fc5c4b8247e9045fd886ae49a8 | /tests/servo_motor_calibrate/servo_motor_calibrate.ino | daf243402f7bf63ffc2029ecabbc229ca34ccf02 | [] | no_license | timdhughes/arduino-smart-car | a50a4ffefe11ba4608baa991ee51b07f59d09235 | 4080f0eaee5701755dfad04655d6a0935fc16838 | refs/heads/master | 2022-10-04T06:28:00.043910 | 2020-06-06T22:09:27 | 2020-06-06T22:09:27 | 256,870,083 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 467 | ino | servo_motor_calibrate.ino | // Run this program when attaching the proximity sensor to the servo motor.
// This program puts the proximity sensor at 90 degrees, directly in front of the smart car.
#include <Servo.h>
Servo myservo;
void setup() {
// SG90 datasheet states that the minimum pulse width is 1000 us and maxmimum is 2000 us
// After some experimentation, applying a scale factor of 3/4 gave the best results.
myservo.attach(9);
myservo.write(90);
}
void loop() {}
|
f86ea67d1357c1f31e6a621aafdf0d7bf970ec7f | edf87bbd55c30434839f21d404c60b7dce6105cd | /Particula.h | c9e189d4e7fef10cee119e886dcbdfb8f21c93f4 | [] | no_license | chacon13/ciber-github | e52fb0560041677625c1f61194cc51ecf35ca4d2 | 229c402395b3d9e52dd9b3643413bd72bd5f58ae | refs/heads/master | 2020-04-12T00:38:07.152765 | 2018-12-18T00:39:44 | 2018-12-18T00:39:44 | 162,206,478 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,041 | h | Particula.h | /*
* @file Particula.h
* @title Abstracción de una partícula
* @author José Ángel Pastrana Padilla
* @email japp0005@red.ujaen.es
*/
#ifndef PARTICULA_H
#define PARTICULA_H
/**
* @brief Partícula ubicada en un espacio tridimensional y con masa concreta.
*/
class Particula {
private:
unsigned int x, y, z, /**< Posición dentro de la matriz. */
masa; /**< Masa de la partícula. */
public:
/**
* @brief Constructor por defecto.
* @param _x Posición de la partícula respecto al eje x.
* @param _y Posición de la partícula respecto al eje y.
* @param _z Posición de la partícula respecto al eje z.
* @param _masa Masa de la partícula. Defecto: 1.
*/
Particula(const unsigned int _x, const unsigned int _y, const unsigned int _z, const unsigned int _masa=1);
/**
* @brief Constructor por copia
* @param orig Objeto de origen a copiar
*/
Particula(const Particula& orig);
virtual ~Particula(); /**< Destructor de la partícula. */
/**
* @brief Obtener la masa de la partícula.
* @return Valor de la masa.
*/
const unsigned int getMasa() const;
/**
* @brief Aumentar masa de la partícula.
* @param _masa Variación a aplicar de la masa.
*/
void aumentaMasa(const unsigned int _masa);
/**
* @brief Actualizar la posición de la partícula.
* @param _x Nueva posición de la partícula respecto al eje x.
* @param _y Nueva posición de la partícula respecto al eje y.
* @param _z Nueva posición de la partícula respecto al eje z.
*/
void actualizaPosicion(const unsigned int _x, const unsigned int _y, const unsigned int _z);
const unsigned int getZ() const; /**< Observador del eje Z para la partícula. */
const unsigned int getY() const; /**< Observador del eje Y para la partícula. */
const unsigned int getX() const; /**< Observador del eje X para la partícula. */
};
#endif /* PARTICULA_H */
|
801a3eff65543159406d14cf91c4043ec188b688 | b64188a7ad093fe24fb06df2605e2601ba503766 | /Main.day1.cpp | a4070f5c91e9e8d40eb06ba0b7e1ca397ffa2e6a | [] | no_license | giuscri/cpluplusTour | 6c96e0234b1b734104225cdf176be0c5caa31cf0 | 2f33ba4428546984da4bbea283b805e0a80dc942 | refs/heads/master | 2016-09-06T21:21:47.113324 | 2015-09-23T08:04:07 | 2015-09-23T08:04:07 | 42,775,694 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,372 | cpp | Main.day1.cpp | #include <string>
#include <iostream>
#include <assert.h>
namespace NS {
class Complex {
private:
double _real;
double _imaginary;
public:
Complex ();
Complex (double real);
Complex (double real, double imaginary);
double real ();
double imaginary ();
Complex & operator+= (Complex c);
};
}
NS::Complex::Complex () :_real { 0. }, _imaginary { 0. } {}
NS::Complex::Complex (double real) :_real { real }, _imaginary { 0. } {}
NS::Complex::Complex (double real, double imaginary) :_real { real }, _imaginary { imaginary } {}
double NS::Complex::real () { return this->_real; }
double NS::Complex::imaginary () { return this->_imaginary; }
NS::Complex & NS::Complex::operator+= (NS::Complex c) {
this->_real += c.real();
this->_imaginary += c.imaginary();
return *this;
}
bool operator== (NS::Complex c, NS::Complex d) {
return c.real() == d.real() && c.imaginary() == d.imaginary();
}
std::ostream & operator<< (std::ostream & os, NS::Complex c) {
os << "@" << &c << ":";
os << c.real() << "," << c.imaginary();
return os;
}
int
main (int argc, char ** argv) {
NS::Complex c(3, -2);
assert(c == c);
c += NS::Complex(1, 0);
assert(c.imaginary() == -2);
assert(c == NS::Complex(4, -2));
return 0;
}
|
b2176bdef13e1d960e48cf6cec13b850891b88b7 | 6fb361e086e445c16150397453bfbb086082a8f8 | /GameView/GameCamera.h | 8b7c3cfe0fe14815d5bd60a25dd69d86a0d2e72d | [] | no_license | blockspacer/EightEngine | d16d5df253697379e14309644a459f115ef449c1 | 61f7f1535063fae06200291fe0e772c454388341 | refs/heads/master | 2021-04-13T15:28:50.818682 | 2016-09-01T20:17:54 | 2016-09-01T20:17:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,478 | h | GameCamera.h | #pragma once
__declspec(align(16))
struct Frustum
{
DirectX::XMFLOAT4 Planes[6];
DirectX::XMFLOAT4 AbsPlanes[6];
};
class GameCamera
{
public:
GameCamera();
virtual ~GameCamera() { }
// Create projection matrix from field of view angle Y, aspect ratio,
// near and far plane
void CreateProjMatrix(float fovY, float aspectRatio, float nearZ, float farZ);
// Look on specific target
// Parameters:
// position -> camera position
// target -> on which place should camera look to
// up -> up direction in world(in most cases -> 0.f, 1.f, 0.f)
void LookAt(DirectX::FXMVECTOR position, DirectX::FXMVECTOR target,
DirectX::FXMVECTOR up);
// Pure virtual method
// Every type of game camera should override it
// This should be called every frame
virtual void VUpdate(DirectX::FXMVECTOR actorPosition) = 0;
// Adding pitch rotation, which will be computed in VUpdate
void Pitch(float angleInRadians)
{
m_Pitch += angleInRadians;
}
// Adding yaw rotation, which will be computed in VUpdate
void Yaw(float angleInRadians)
{
m_Yaw += angleInRadians;
}
// Set camera position
void SetPosition(const DirectX::XMFLOAT3 &position)
{
m_Position = position;
}
// Set camera position from SIMD register
void SetPosition(DirectX::FXMVECTOR position)
{
DirectX::XMStoreFloat3(&m_Position, position);
}
// Set offset from actor
virtual void SetOffsetFromActor(const DirectX::XMFLOAT3 &offsetFromActor)
{
m_OffsetFromActor = offsetFromActor;
}
// Set offset from actor from SIMD register
virtual void SetOffsetFromActor(DirectX::FXMVECTOR offsetFromActor)
{
DirectX::XMStoreFloat3(&m_OffsetFromActor, offsetFromActor);
}
// Pack position into SIMD register and return it
DirectX::XMVECTOR GetPosition() const
{
return DirectX::XMLoadFloat3(&m_Position);
}
// Pack looking direction into SIMD register and return it
DirectX::XMVECTOR GetLookingDirection() const
{
return DirectX::XMLoadFloat3(&m_Look);
}
// Pack right direction into SIMD register and return it
DirectX::XMVECTOR GetRightDirection() const
{
return DirectX::XMLoadFloat3(&m_Right);
}
// Pack up direction into SIMD register and return it
DirectX::XMVECTOR GetUpDirection() const
{
return DirectX::XMLoadFloat3(&m_Up);
}
// Pack view matrix into SIMD registers and return it
// View matrix is transformation from world space into camera space
DirectX::XMMATRIX GetViewMatrix() const
{
return DirectX::XMLoadFloat4x4(&m_ViewMatrix);
}
// Pack projection matrix into SIMD registers and return it
DirectX::XMMATRIX GetProjMatrix() const
{
return DirectX::XMLoadFloat4x4(&m_ProjMatrix);
}
// Pack view and projection matrix into SIMD register and perform multiplying
// Result is matrix which transform from world space directly to NDC space
DirectX::XMMATRIX GetViewProjMatrix() const
{
return DirectX::XMMatrixMultiply(GetViewMatrix(), GetProjMatrix());
}
// Get frustum for frustum culling tests
const Frustum &GetFrustum() const
{
return m_Frustum;
}
protected:
Frustum m_Frustum;
DirectX::XMFLOAT4X4 m_ViewMatrix;
DirectX::XMFLOAT4X4 m_ProjMatrix;
DirectX::XMFLOAT3 m_Position;
DirectX::XMFLOAT3 m_Look;
DirectX::XMFLOAT3 m_Up;
DirectX::XMFLOAT3 m_Right;
DirectX::XMFLOAT3 m_OffsetFromActor;
float m_Yaw;
float m_Pitch;
// Compute view matrix from position, look, up and right vectors
void Update();
// Compute frustum from ViewProj matrix
void ComputeFrustum();
};
|
bf1aa47f7cd82298eab6ada677dde301b04fe70c | 08911cdf712375b0ede3e2e22683b1f20323d1ee | /orderby.cpp | fe43ba3358fbd3f7b532b7cd98632f47b042f2b0 | [] | no_license | MrSoir/Gosh_rev | 291d27c244cee4c568ad6ea6309f597f44a49201 | a77cca5a2a40032b76a098879a032f7717967771 | refs/heads/master | 2020-04-19T17:00:30.423715 | 2019-02-10T06:51:39 | 2019-02-10T06:51:39 | 168,321,725 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,229 | cpp | orderby.cpp | #include "orderby.h"
Order::Order()
: ordered_by(ORDERED_BY::NAME),
reversedOrdered(false)
{
}
Order::Order(const Order& order)
: ordered_by(order.ordered_by),
reversedOrdered(order.reversedOrdered)
{
}
Order& Order::operator=(const Order& order)
{
this->ordered_by = order.ordered_by;
this->reversedOrdered = order.reversedOrdered;
return *this;
}
bool Order::operator==(const Order &order)
{
return order.ordered_by == this->ordered_by &&
order.reversedOrdered == this->reversedOrdered;
}
bool Order::operator!=(const Order &order)
{
return order.ordered_by != this->ordered_by ||
order.reversedOrdered != this->reversedOrdered;
}
QString Order::toString() const
{
QString order_str;
if(this->ordered_by == ORDERED_BY::NAME)
order_str = "NAME";
else if(this->ordered_by == ORDERED_BY::MOD_DATE)
order_str = "MOD_DATE";
else if(this->ordered_by == ORDERED_BY::SIZE)
order_str = "SIZE";
else if(this->ordered_by == ORDERED_BY::TYPE)
order_str = "TYPE";
QString reverse_str = reversedOrdered ? "true" : "false";
return QString("Order: %1 - reverse: %2").arg(order_str).arg(reverse_str);
}
|
8bd3743d5bdc3c4a13de767a52357456cecae0fc | 89fc6b5eba8345cbb4719daa29e26656c9955864 | /Source/Io/PodVehicle.cpp | f0a593b339d39c8c2a3694ff7c523d253c910acb | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | glhrmfrts/Io | 47749c1895bf26f0208f22fe42a6c60df5165b54 | 2df31f550d3d8f0501f5de17290e781af5fcdcb3 | refs/heads/master | 2022-04-17T00:51:34.946565 | 2020-04-15T05:40:28 | 2020-04-15T05:40:28 | 255,816,661 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,118 | cpp | PodVehicle.cpp | #include <stdexcept>
#include <Urho3D/Core/Main.h>
#include <Urho3D/IO/FileSystem.h>
#include <Urho3D/IO/File.h>
#include <Urho3D/Graphics/Texture2D.h>
#include <Urho3D/Resource/Image.h>
#include <Urho3D/Graphics/Model.h>
#include <Urho3D/Graphics/Material.h>
#include <Urho3D/Graphics/VertexBuffer.h>
#include <Urho3D/Graphics/IndexBuffer.h>
#include <Urho3D/Graphics/Geometry.h>
#include <Urho3D/Graphics/Technique.h>
#include <Urho3D/Resource/ResourceCache.h>
#include "PodVehicle.h"
#include "PodModelGen.h"
static constexpr int TEXTURE_WIDTH = 128;
static constexpr int TEXTURE_HEIGHT = 128;
// Unknown data structures
struct PositionData
{
uint8_t unknown_0000[57];
uint8_t Unknown_0039;
uint8_t unknown_003A[2];
uint32_t Unknown_003C;
uint32_t Unknown_0040;
uint32_t Unknown_0044;
fp1616_t Position[3]; // [0..3].xy, -[4].z
uint32_t Unknown_0054;
uint8_t unknown_0058[56];
uint32_t Unknown_0090;
uint32_t Unknown_0094;
uint32_t Unknown_0098;
uint32_t Unknown_009C;
uint32_t Unknown_00A0;
uint8_t unknown_00A4[8];
uint32_t Unknown_00AC;
uint32_t Unknown_00B0;
uint32_t Unknown_00B4;
uint32_t Unknown_00B8;
uint32_t Unknown_00BC;
uint32_t Unknown_00C0;
uint8_t unknown_00C4[20];
};
struct UnknownData // one big struct
{
PositionData pos[5];
uint8_t unknown_0438[4];
uint32_t unknown_043C;
uint8_t unknown_0440[8];
uint8_t Unknown_0448;
uint8_t unknown_0449[2];
uint8_t Unknown_044B;
uint8_t Unknown_044C[36];
uint8_t unknown_0470[4];
uint32_t Unknown_0474;
uint8_t unknown_0478[4];
uint32_t Unknown_047C;
uint32_t Unknown_0480;
uint32_t Unknown_0484;
uint32_t Unknown_0488;
uint32_t Unknown_048C;
//POD1: this block is 4 bytes larger
uint8_t unknown_0490[100];
uint32_t unknown_04F4;
uint8_t unknown_04F8[28];
uint32_t Unknown_0514;
//...
uint32_t Unknown_0518;
uint32_t Unknown_051C;
uint32_t Unknown_0520;
uint8_t unknown_0524[4];
uint32_t Unknown_0528;
uint8_t unknown_052C[12];
uint32_t Unknown_0538;
uint32_t Unknown_053C;
uint32_t Unknown_0540;
uint32_t Unknown_0544;
uint32_t Unknown_0548;
uint32_t Unknown_054C; //POD1: 00000002, POD2: 00000001
uint8_t unknown_0550[8];
struct List
{
uint32_t Count;
UniquePtr<uint32_t> Array;
} list;
};
static int RegionToWheelIndex(PodVehicleRegion reg)
{
int idx = -1;
switch (reg)
{
case VR_FRONT_R:
idx = 0;
break;
case VR_REAR_R:
idx = 1;
break;
case VR_FRONT_L:
idx = 2;
break;
case VR_REAR_L:
idx = 3;
break;
}
return idx;
}
PodVehicle::PodVehicle(Context* context, const String& fileName)
: PodBdfFile(context, fileName)
{
fileType_ = FILE_VEHICLE;
}
bool PodVehicle::LoadData()
{
name_ = ReadPodString();
{
UnknownData unknownData;
Read(&unknownData, sizeof(UnknownData) - sizeof(UnknownData::List));
unknownData.list.Count = ReadUInt();
unknownData.list.Array = new uint32_t[unknownData.list.Count];
Read(unknownData.list.Array.Get(), unknownData.list.Count * sizeof(uint32_t));
for (int i = 0; i < 5; i++)
{
offsets_[i] = Vector3(
FloatFromFP1616(unknownData.pos[i].Position[1]),
FloatFromFP1616(unknownData.pos[i].Position[2]),
FloatFromFP1616(unknownData.pos[i].Position[0])
);
}
}
// Read material data
materialData_.Name = ReadPodString();
if (materialData_.Name != "GOURAUD")
ReadTextureList(materialData_.TexList, TEXTURE_WIDTH, TEXTURE_HEIGHT);
// Read objects data
objectsData_.NamedFaces = ReadUInt();
unsigned int objflags = objectsData_.NamedFaces ? FLAG_NAMED_FACES : 0;
objflags |= FLAG_OBJ_HAS_PRISM;
// Read chassis objects
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 6; j++)
{
ReadObject(objectsData_.ChassisObjects[i][j], objflags);
}
}
// Read wheels objects
for (int i = 0; i < 4; i++)
{
ReadObject(objectsData_.WheelObjects[i], objflags);
}
// Read shadow objects
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 2; j++)
{
ReadObject(objectsData_.ShadowObjects[i][j], objflags &~ FLAG_OBJ_HAS_PRISM); // shadow objects have no prism
}
}
// Read collision meshes
for (int i = 0; i < 2; i++)
{
auto col = objectsData_.CollisionData + i;
col->MaterialName = ReadPodString();
col->NamedFaces = ReadUInt();
unsigned int cflags = col->NamedFaces ? FLAG_NAMED_FACES : 0;
cflags |= FLAG_OBJ_HAS_PRISM;
ReadObject(col->ObjData, cflags);
// unknown stuff
col->Unknown_1 = ReadUInt();
Read(col->Unknown_2, sizeof(col->Unknown_2));
col->Unknown_3 = ReadUInt();
col->Unknown_4 = ReadUInt();
col->Unknown_5 = ReadUInt();
col->Unknown_6 = new uint8_t[col->Unknown_5 * 64];
Read(col->Unknown_6, col->Unknown_5 * 64);
}
// Read noise
Read(&noiseData_, sizeof(noiseData_));
// Read characteristics
Read(&charsData_, sizeof(charsData_));
// Generate models
bodyModelGen_ = new PodModelGen(context_, materialData_.TexList);
for (int i = 0; i < 6; i++)
bodyModelGen_->AddObject(objectsData_.ChassisObjects[0][i]);
for (int i = 0; i < 4; i++)
wheelsModelGen_.Push(UniquePtr<PodModelGen>(new PodModelGen(context_, materialData_.TexList)));
wheelsModelGen_[RegionToWheelIndex(VR_FRONT_L)]->AddObject(objectsData_.WheelObjects[RegionToWheelIndex(VR_FRONT_L)]);
wheelsModelGen_[RegionToWheelIndex(VR_FRONT_R)]->AddObject(objectsData_.WheelObjects[RegionToWheelIndex(VR_FRONT_R)]);
wheelsModelGen_[RegionToWheelIndex(VR_REAR_L)]->AddObject(objectsData_.WheelObjects[RegionToWheelIndex(VR_REAR_L)]);
wheelsModelGen_[RegionToWheelIndex(VR_REAR_R)]->AddObject(objectsData_.WheelObjects[RegionToWheelIndex(VR_REAR_R)]);
return true;
}
Model* PodVehicle::GetChassisModel(PodVehicleCondition cond)
{
return bodyModelGen_->GetModel();
}
const Vector<SharedPtr<Material>>& PodVehicle::GetChassisMaterials(PodVehicleCondition cond)
{
return bodyModelGen_->GetMaterials();
}
Vector3 PodVehicle::GetChassisOffset()
{
return offsets_[4];
}
Model* PodVehicle::GetWheelModel(PodVehicleRegion reg)
{
return wheelsModelGen_[RegionToWheelIndex(reg)]->GetModel();
}
const Vector<SharedPtr<Material>>& PodVehicle::GetWheelMaterials(PodVehicleRegion reg)
{
return wheelsModelGen_[RegionToWheelIndex(reg)]->GetMaterials();
}
Vector3 PodVehicle::GetWheelOffset(PodVehicleRegion region)
{
switch (region)
{
case VR_FRONT_R:
return offsets_[0];
case VR_REAR_R:
return offsets_[1];
case VR_FRONT_L:
return offsets_[2];
case VR_REAR_L:
return offsets_[3];
}
return Vector3();
} |
7758c9e37bcd0b2f406e917e3c7517701cd5be19 | b879a43f9cce18c058efeba7293288ffa6173f25 | /qt/projet_editeur_pokemon/test_editeur_2/ihm/dialogue/dialogueselectlieu.h | 5f28f2e4ab68241314e78b972ae5043b72799270 | [] | no_license | Cardman/tutorials | a115081832b5950898c80ccb60c7b8e279faf278 | 7df904450b6f671ec640d5fcf7e41928a2b35bb6 | refs/heads/master | 2023-04-14T21:16:12.581163 | 2023-04-10T08:49:11 | 2023-04-10T08:49:11 | 80,229,805 | 0 | 0 | null | 2023-03-07T01:27:33 | 2017-01-27T17:31:49 | Java | UTF-8 | C++ | false | false | 658 | h | dialogueselectlieu.h | #ifndef DIALOGUESELECTLIEU_H
#define DIALOGUESELECTLIEU_H
#include <QDialog>
#include <QList>
#include "serialisable/base_donnees/hashmap.h"
class QTableWidget;
/***/
class DialogueSelectLieu: public QDialog{
int langue;
QTableWidget *table;
QList<int> cles_lieux;
static HashMap<QString,QStringList> init_elements_ihm();
QString traduire(const QString&)const;
const static HashMap<QString,QStringList> _elements_ihm_;
static QString traduire(const QStringList&,const QString&,int);
static QString traduire_revert(const QStringList&,const QString&,int);
public:
DialogueSelectLieu(int,bool,QWidget*);
int lieu_select()const;
};
#endif
|
3debd59f2f1b4e48d97fda4a7abe51c0ec50c27d | be101025ed0211232fe5d8bf312022762796435b | /MapEditor/Actions/FillTriangle.cpp | 07f1d5e099da7a62b95a7d6bfb7dec5358c87954 | [] | no_license | twrwr/Calamity | cc13bcfd638d33f5151ad96c3bec4a71586579ec | 05322d7c9d1dd2acfb641fd091e022aa934a81f0 | refs/heads/master | 2020-09-28T04:52:24.524033 | 2015-08-29T20:55:20 | 2015-08-29T20:55:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,779 | cpp | FillTriangle.cpp | #include "FillTriangle.h"
FillTriangle::FillTriangle(MapEditorSelection* selection, const char* textureName) :
selection(selection),
triangleId(-1),
textureName(textureName),
verticesToReselect(),
firstApply(true)
{
// size must be 3 and they must be on the same layer
verticesToReselect = selection->getSelectedVertices();
}
void FillTriangle::apply() {
GameManager* gameManager = selection->getGameManager();
if (firstApply) {
SharedTriangleData* sharedTriangleData = selection->getSharedTriangleData();
for (auto& it : verticesToReselect)
selection->selectVertex(it.first, it.second);
unsigned int v1, v2, v3;
unsigned int layerId;
unordered_map<unsigned int, unsigned int>::iterator it = verticesToReselect.begin();
layerId = it->second;
v1 = it->first;
++it;
v2 = it->first;
++it;
v3 = it->first;
TriangleObject* triangle = new TriangleObject(sharedTriangleData, v1, v2, v3, textureName.c_str());
triangleId = gameManager->addGameObject(triangle, layerId);
for (auto& it : verticesToReselect)
selection->selectVertex(it.first, it.second);
//spriteManager->uploadTextures();
firstApply = false;
}
else {
for (auto& it : verticesToReselect)
selection->selectVertex(it.first, it.second);
gameManager->restoreGameObject(triangleId);
for (auto& it : verticesToReselect)
selection->selectVertex(it.first, it.second);
}
gameManager->getRenderer()->getTextureManager()->upload();
}
void FillTriangle::revert() {
GameManager* gameManager = selection->getGameManager();
for (auto& it : verticesToReselect)
selection->selectVertex(it.first, it.second);
gameManager->removeGameObject(triangleId);
for (auto& it : verticesToReselect)
selection->selectVertex(it.first, it.second);
}
|
b79b0e6e87018f2c5257b17222a3e1d2b8ee0426 | 03046ff2e9bbc940ccaf82917a8eed2f8dcfc67b | /layer_raster.h | 5ccea0a59df908990ed3f05e742e762843b18287 | [] | no_license | joojinho/brigantine | 8ed74211bd7f071a2032a8505626efb8d7b224b5 | 5c34a837cf6c360e08a96b17e4bf478f9f39f9ec | refs/heads/master | 2021-01-10T09:22:11.763271 | 2013-06-08T09:22:26 | 2013-06-08T09:22:26 | 55,665,052 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,472 | h | layer_raster.h | // Andrew Naplavkov
#ifndef LAYER_RASTER_H
#define LAYER_RASTER_H
#include "layer.h"
class layer_raster : public layer {
const brig::pyramid_def m_raster;
std::vector<brig::table_def> m_tbls;
size_t get_level(const frame& fr);
std::string get_raster_column(size_t level) const;
layer_raster(provider_ptr pvd, const brig::pyramid_def& raster, const std::vector<brig::table_def>& tbls);
public:
layer_raster(provider_ptr pvd, const brig::pyramid_def& raster);
QString get_icon() override { return ":/res/palette.png"; }
brig::identifier get_identifier() override { return m_raster.id; }
size_t get_levels() override { return m_raster.levels.size(); }
brig::identifier get_geometry(size_t lvl) override { return m_raster.levels[lvl].geometry; }
brig::table_def get_table_def(size_t lvl) override;
void reset_table_defs() override;
bool is_raster() override { return true; }
layer* fit(provider_ptr pvd) override;
void reg() override;
void reg(std::vector<std::string>& sql) override;
void unreg() override;
std::shared_ptr<brig::rowset> attributes(const frame& fr) override;
std::shared_ptr<brig::rowset> drawing(const frame& fr) override;
void draw(const std::vector<brig::variant>& row, const frame& fr, QPainter& painter) override;
bool has_spatial_index(const frame& fr) override;
double native_scale(const frame& fr) override;
}; // layer_raster
#endif // LAYER_RASTER_H
|
3a21d422eaa950c4951afd09e65ded142937a2a3 | 04a9a6b048517ce519fbdec070e9a15e124ff380 | /Solutions/213.house-robber-ii.cpp | 8ade37a826e5ab4a532f0909f7490f0c35fe81b8 | [] | no_license | prudentboy/leetcode | 62e8e8bd536832d8bcd1897504db82aa0685f9dc | d21075e970640636f7ba0a44a0e79476654400e5 | refs/heads/master | 2022-12-02T21:22:18.011020 | 2020-08-24T10:53:16 | 2020-08-24T10:53:16 | 117,795,033 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 731 | cpp | 213.house-robber-ii.cpp | /*
* @lc app=leetcode id=213 lang=cpp
*
* [213] House Robber II
*/
class Solution {
public:
int rob(vector<int>& nums) {
const size_t len(nums.size());
if (len == 0) return 0;
if (len == 1) return nums[0];
if (len == 2) return max(nums[0], nums[1]);
return max(robRange(nums, 0, len - 1), robRange(nums, 1, len));
}
private:
int robRange(const vector<int>& nums, size_t begin, size_t end)
{
int p(0), pp(0), now(0);
pp = nums[begin];
p = max(nums[begin], nums[begin + 1]);
for (int i(begin + 2); i < end; ++i)
{
now = max(p, pp + nums[i]);
pp = p;
p = now;
}
return p;
}
};
|
c272bbc401a309568157a0cda6d1a684a6c44b6e | 44aa76e2dbf8c8dbe83b8c54ea8cdcee7031f5ac | /MultifileProgram/example.cpp | c3e5921d294dbef93fe57c6064e8cd0ba8fdd700 | [
"MIT"
] | permissive | Avelyev/Cplusplus | b66ab98b7e35e0e47ad827645878db2a60e5606f | 3e9f99e8421ea6f747a6b00302deafffe1f930b6 | refs/heads/master | 2021-01-21T21:57:32.165827 | 2017-06-22T19:09:42 | 2017-06-22T19:09:42 | 95,136,290 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 630 | cpp | example.cpp | /* This file is empty, since Example class is a template, and C ++ implementation of template class must be in the header-file. When you create don't template class is usually an implementation must necessarily be in the .cpp-file!
* Этот файл пуст, т.к. класс Example является шаблонным, а в C++ реализация шаблонного класса должна находиться в header-файле. При создании обычного НЕ шаблонного класса реализация обязательно должна находиться в .cpp-файле! */
|
1ecdd6be02965b0478ca603411cef2ec00cb183b | 8309704685d2fa8b868b494c5db3b602dd669f67 | /src/company-parser/RecursiveParser.hpp | 531351206796ac22ee0c86a3343bd2392bc39633 | [] | no_license | runya-v/run | 250a9b9a15ee8eaaf397e1ce3050fd4e4c5ddedf | 49890049c263ebf2c57de7b1020e534d392b333b | refs/heads/master | 2021-01-02T22:39:12.636709 | 2015-03-06T15:21:37 | 2015-03-06T15:21:37 | 7,263,502 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 511 | hpp | RecursiveParser.hpp | /*!
* \brief Интерефейс, предоставляющий разбора XML файла.
* \author Rostislav Velichko.
* \date 15.06.2011
*/
#pragma once
#include <boost/property_tree/ptree.hpp>
namespace NParser {
typedef boost::property_tree::ptree TPtree;
typedef boost::property_tree::ptree::value_type TPtreeVtype;
struct RecursiveParser {
/*!
* \brief
* \param[ou]
* \param[in]
*/
RecursiveParser(TPtree);
};
}
|
3ba5fc53caaf4568fd92e59614f96cb7dd08389b | 83cfe28f0ed65742cb602011929675a222df4bb6 | /src/RigelGA/PlotingHandler.cpp | be6d29bb2b9e852d0790a6a5a5c53f79614f6b8f | [] | no_license | RigelStudio/RigelGIS | 362b14bd44ac4258761a9c00bcef70cc07687935 | 89b477bedce77313b282371c04abaaab17ba58d6 | refs/heads/master | 2021-01-22T09:55:17.477958 | 2019-12-16T14:27:31 | 2019-12-16T14:27:31 | 102,331,613 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,903 | cpp | PlotingHandler.cpp | #include "PlotingHandler.h"
#include "MapCore/SigCenter.h"
PlotingHandler::PlotingHandler()
{
m_pPlotingBase = nullptr;
}
PlotingHandler::~PlotingHandler(void)
{
}
void PlotingHandler::setEnable(bool isEnable)
{
m_isEnable = isEnable;
}
void PlotingHandler::setPloting(PlotingBase* measure)
{
m_pPlotingBase = measure;
}
bool PlotingHandler::handle( const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa )
{
if (!m_isEnable)
{
return false;
}
if (m_viewer == nullptr)
{
m_viewer = dynamic_cast<osgViewer::Viewer*>(&aa);
return false;
}
if (m_pPlotingBase == nullptr)
{
return false;
}
switch (ea.getEventType())
{
case osgGA::GUIEventAdapter::PUSH:
{
m_posPUSH = pickPos(ea, aa);
break;
}
case osgGA::GUIEventAdapter::MOVE:
{
osg::Vec3d movePos = pickPos(ea, aa);
m_pPlotingBase->moveEvent(MEMath::WCSToGCS(movePos));
break;
}
case osgGA::GUIEventAdapter::RELEASE:
{
m_posRelease = pickPos(ea, aa);
if (ea.getButton() == osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON)
{
if (m_posPUSH == m_posRelease && m_pPlotingBase->isStart())
{
m_pPlotingBase->clickEvent(MEMath::WCSToGCS(m_posRelease));
return true;
}
}
else if (ea.getButton() == osgGA::GUIEventAdapter::RIGHT_MOUSE_BUTTON)
{
if (m_posPUSH == m_posRelease && m_pPlotingBase->isStart())
{
m_pPlotingBase->rightEvent(MEMath::WCSToGCS(m_posRelease));
SigCenter::ins()->emitPlotEnd();
return true;
}
}
break;
}
}//switch
return false;
}
osg::Vec3d PlotingHandler::pickPos(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
{
osg::Vec3d interPos;
osgUtil::LineSegmentIntersector::Intersections intersecter;
if (m_viewer->computeIntersections(ea, intersecter))
{
osgUtil::LineSegmentIntersector::Intersections::iterator iter;
iter = intersecter.begin();
interPos = iter->getWorldIntersectPoint();
}
return interPos;
}
|
9a4d0c66cafd2900f8195812e09c5f5d6fc8e501 | 7ca156ebc1e108c87df6606c834280035c4ea168 | /Projet/src/MyGraphicEngine.cpp | 9cd366d5b9f008954b6df3068c43cfd3c19fa96d | [] | no_license | Viperlion/CPP | cd0a6d58389b24c56774656c6330f18fa02f57a0 | e4f96a06be4e36907765adcf3a8f64442994b11d | refs/heads/master | 2021-08-31T20:52:53.108071 | 2017-12-22T21:46:31 | 2017-12-22T21:46:31 | 115,150,301 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,186 | cpp | MyGraphicEngine.cpp | #include <string>
#include "MyGraphicEngine.h"
#include "MyGameEngine.h"
void MyGraphicEngine::Draw(){
glutReshapeWindow(800, 600);
drawGameInfos();
int i;
for (i = 0; i < damier->size(); i++) {
(*damier)[i]->draw();
if ((*damier)[i]->isActive()) {
(*damier)[i]->drawMenu();
}
if ((*damier)[i]->haveTurret()) {
(*damier)[i]->drawTurret();
}
}
for (i = 0; i < 4; i++) {
if (game->get_wave_info(i)) {
GraphicPrimitives::drawFillRect2D(0.96f, 0.8f - 0.2f * i, 0.04f, 0.2f, 0.8f, 0.8f, 0.8f, 0.9f);
}
}
if ((game->is_start())) {
for (i = 0; i < damier->size(); i++) {
if ((*damier)[i]->haveTurret() && (*damier)[i]->isShooting()) {
(*damier)[i]->drawMissile();
}
}
}
if (asteroids->size() != 0) {
for (i = 0; i < asteroids->size(); i++) {
(*asteroids)[i]->draw_asteroid();
}
}
}
void MyGraphicEngine::drawGameInfos() {
str_argent = strcat(new char[10]{ 'A','r','g','e','n','t',' ',':',' ','\0' }, _itoa(game->getMoney(), str, 10));
str_vie = strcat(new char[7]{ 'V','i','e',' ',':',' ','\0' }, _itoa(game->getLife(), str, 10));
str_vague = strcat(new char[9]{ 'V','a','g','u','e',' ',':',' ','\0' }, _itoa(game->getWave(), str, 10));
if (game->is_game_over()) {
if (game->getLife() <= 0) {
str_vie = new char[7]{ 'W','a','s','t','e','d','\0' };
}
else {
str_vie = new char[7]{ 'W','i','n','n','e','r','\0' };
}
}
else {
str_vie = strcat(new char[7]{ 'V','i','e',' ',':',' ','\0' }, _itoa(game->getLife(), str, 10));
}
if (game->is_start() && asteroids->size()!=0) {
str_wave_info = strcat(new char[17]{ 'E','n','e','m','y',' ','r','e','m','a','i','n','s',' ',':',' ','\0' }, _itoa(asteroids->size(), str, 10));
}
else {
str_wave_info = new char[15]{'[','S',']',' ','S','t','a','r','t',' ','w','a','v','e','\0'};
}
GraphicPrimitives::drawText2D(str_vie, 0.8f, 0.1f, 1.0f, 0.0f, 0.0f);
GraphicPrimitives::drawText2D(str_argent, -0.98f, 0.1f, 1.0f, 1.0f, 0.0f);
GraphicPrimitives::drawText2D(str_vague, -0.1f, 0.1f, 0.9f, 0.9f, 0.9f);
GraphicPrimitives::drawLine2D(-1.0f, 0.05f, 1.0f, 0.05f, 0.8f, 0.8f, 0.8f);
GraphicPrimitives::drawText2D(str_wave_info, 0.4f, -0.15f, 1.0f, 0.4f, 0.0f);
} |
f560961d67ff9986227cc8d15459d6c486f82ae7 | 50582d297264a5a924bfaf8dfdc06cb925c850ab | /baekjoonPractice/2565.cpp | 2cbb0782d397c2e25b4ddb7ccb6f548336af779b | [] | no_license | rltn2121/Baekjoon | 81ff3a1f6c2c5437079d19b82871fde273305a19 | d4848e7f984f60faf4fa4ec3e050dd3ae58f9ada | refs/heads/master | 2021-10-26T16:55:31.198992 | 2021-10-08T08:35:44 | 2021-10-08T08:35:44 | 243,722,687 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 633 | cpp | 2565.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#define pii pair<int, int>
using namespace std;
pii arr[101];
int arr2[101];
int dp[101];
vector<vector<int> > v(501);
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> arr[i].first >> arr[i].second;
sort(arr, arr + n);
int cnt = 0;
for (int i = 0; i < n; i++)
dp[i] = 1;
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n; j++) {
if (arr[j].second > arr[i].second) {
dp[j] = max(dp[i] + 1, dp[j]);
cnt = max(cnt, dp[j]);
}
}
}
cout << n-cnt;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.