CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
Message Class Reference

#include <Message.h>

Static Public Member Functions

static CARTA::CloseFile CloseFile (int32_t file_id)
 
static CARTA::OpenFile OpenFile (std::string directory, std::string file, bool lel_expr, std::string hdu, int32_t file_id, bool support_aips_beam, CARTA::RenderMode render_mode=CARTA::RenderMode::RASTER)
 
static CARTA::SetImageChannels SetImageChannels (int32_t file_id, int32_t channel, int32_t stokes, CARTA::CompressionType compression_type=CARTA::CompressionType::NONE, float compression_quality=-1)
 
static CARTA::AddRequiredTiles AddRequiredTiles (int32_t file_id, CARTA::CompressionType compression_type, float compression_quality, const std::vector< int32_t > &tiles)
 
static CARTA::Point Point (float x, float y)
 
static CARTA::Point Point (const casacore::Vector< casacore::Double > &input, int x_index=0, int y_index=1)
 
static CARTA::Point Point (const std::vector< casacore::Quantity > &input, int x_index=0, int y_index=1)
 
static CARTA::Point Point (const std::vector< double > &input, int x_index=0, int y_index=1)
 
static CARTA::SetRegion SetRegion (int32_t file_id, int32_t region_id, CARTA::RegionType region_type, std::vector< CARTA::Point > control_points, float rotation)
 
static CARTA::ImageBounds ImageBounds (int32_t x_min, int32_t x_max, int32_t y_min, int32_t y_max)
 
static CARTA::SetRegion SetRegion (int32_t file_id, int32_t region_id, const CARTA::RegionInfo &region_info)
 
static CARTA::ConcatStokesFiles ConcatStokesFiles (int32_t file_id, const google::protobuf::RepeatedPtrField< CARTA::StokesFile > &stokes_files)
 
static CARTA::DoublePoint DoublePoint (double x, double y)
 
static CARTA::GaussianComponent GaussianComponent (const CARTA::DoublePoint &center, double amp, const CARTA::DoublePoint &fwhm, double pa)
 
static CARTA::ScriptingRequest ScriptingRequest (uint32_t scripting_request_id, const std::string &target, const std::string &action, const std::string &parameters, bool async, const std::string &return_path)
 
static CARTA::SpectralProfileData SpectralProfileData (int32_t file_id, int32_t region_id, int32_t stokes, float progress, std::string &coordinate, std::vector< CARTA::StatsType > &required_stats, std::map< CARTA::StatsType, std::vector< double > > &spectral_data)
 
static CARTA::SpectralProfileData SpectralProfileData (int32_t stokes, float progress)
 
static CARTA::SpatialProfileData SpatialProfileData (int32_t file_id, int32_t region_id, int32_t x, int32_t y, int32_t channel, int32_t stokes, float value, int32_t start, int32_t end, std::vector< float > &profile, std::string &coordinate, int32_t mip, CARTA::ProfileAxisType axis_type, float crpix, float crval, float cdelt, std::string &unit)
 
static CARTA::SpatialProfileData SpatialProfileData (int32_t x, int32_t y, int32_t channel, int32_t stokes, float value)
 
static CARTA::RasterTileSync RasterTileSync (int32_t file_id, int32_t channel, int32_t stokes, int32_t sync_id, int32_t animation_id, int32_t tile_count, bool end_sync)
 
static CARTA::SetRegionAck SetRegionAck (int32_t region_id, bool success, std::string err_message)
 
static CARTA::RegisterViewerAck RegisterViewerAck (uint32_t session_id, bool success, const std::string &status, const CARTA::SessionType &type)
 
static CARTA::MomentProgress MomentProgress (int32_t file_id, float progress)
 
static CARTA::PvProgress PvProgress (int32_t file_id, float progress, int32_t preview_id=0)
 
static CARTA::FittingProgress FittingProgress (int32_t file_id, float progress)
 
static CARTA::RegionHistogramData RegionHistogramData (int32_t file_id, int32_t region_id, int32_t channel, int32_t stokes, float progress, const carta::HistogramConfig &hist_config)
 
static CARTA::ContourImageData ContourImageData (int32_t file_id, uint32_t reference_file_id, int32_t channel, int32_t stokes, double progress)
 
static CARTA::VectorOverlayTileData VectorOverlayTileData (int32_t file_id, int32_t channel, int32_t stokes_intensity, int32_t stokes_angle, const CARTA::CompressionType &compression_type, float compression_quality)
 
static CARTA::ErrorData ErrorData (const std::string &message, std::vector< std::string > tags, CARTA::ErrorSeverity severity)
 
static CARTA::FileInfo FileInfo (const std::string &name, CARTA::FileType type, int64_t size=0, const std::string &hdu="")
 
static CARTA::RasterTileData RasterTileData (int32_t file_id, int32_t sync_id, int32_t animation_id)
 
static CARTA::StartAnimationAck StartAnimationAck (bool success, int32_t animation_id, const std::string &message)
 
static CARTA::ImportRegionAck ImportRegionAck (bool success, const std::string &message)
 
static CARTA::RegionStatsData RegionStatsData (int32_t file_id, int32_t region_id, int32_t channel, int32_t stokes)
 
static CARTA::Beam Beam (int32_t channel, int32_t stokes, float major_axis, float minor_axis, float pa)
 
static CARTA::ListProgress ListProgress (const CARTA::FileListType &file_list_type, int32_t total_count, int32_t checked_count, float percentage)
 
static CARTA::HeaderEntry * AddHeaderEntry (CARTA::FileInfoExtended &response, std::string name, const std::string &value, CARTA::EntryType type=CARTA::EntryType::STRING, double numeric_value=0.0)
 
static CARTA::HeaderEntry * AddComputedEntry (CARTA::FileInfoExtended &response, std::string name, const std::string &value, CARTA::EntryType type=CARTA::EntryType::STRING, double numeric_value=0.0)
 
static CARTA::FileInfoExtended SetDimensions (CARTA::FileInfoExtended &response, int32_t dimensions, int32_t width, int32_t height, int32_t depth, int32_t stokes)
 
static CARTA::AxesNumbers * AddAxesNumbers (CARTA::FileInfoExtended &response, int32_t spatial_x, int32_t spatial_y, int32_t spectral, int32_t stokes, int32_t depth)
 
static carta::EventHeader GetEventHeader (std::string_view message)
 
template<typename T >
static T DecodeMessage (std::string_view sv_message)
 Decodes a message from a buffer of characters into an object of type T and can be used to decode various types of messages.
 
static std::vector< char > EncodeMessage (CARTA::EventType event_type, uint32_t event_id, const google::protobuf::MessageLite &message)
 Encodes a protobuf message with a CARTA event header for transmission.
 

Private Member Functions

 Message ()
 
 ~Message ()=default
 

Constructor & Destructor Documentation

◆ Message()

Message::Message ( )
inlineprivate

◆ ~Message()

Message::~Message ( )
privatedefault
Here is the call graph for this function:

Member Function Documentation

◆ AddAxesNumbers()

CARTA::AxesNumbers * Message::AddAxesNumbers ( CARTA::FileInfoExtended &  response,
int32_t  spatial_x,
int32_t  spatial_y,
int32_t  spectral,
int32_t  stokes,
int32_t  depth 
)
static
Here is the caller graph for this function:

◆ AddComputedEntry()

CARTA::HeaderEntry * Message::AddComputedEntry ( CARTA::FileInfoExtended &  response,
std::string  name,
const std::string &  value,
CARTA::EntryType  type = CARTA::EntryType::STRING,
double  numeric_value = 0.0 
)
static
Here is the caller graph for this function:

◆ AddHeaderEntry()

CARTA::HeaderEntry * Message::AddHeaderEntry ( CARTA::FileInfoExtended &  response,
std::string  name,
const std::string &  value,
CARTA::EntryType  type = CARTA::EntryType::STRING,
double  numeric_value = 0.0 
)
static
Here is the caller graph for this function:

◆ AddRequiredTiles()

CARTA::AddRequiredTiles Message::AddRequiredTiles ( int32_t  file_id,
CARTA::CompressionType  compression_type,
float  compression_quality,
const std::vector< int32_t > &  tiles 
)
static
Here is the caller graph for this function:

◆ Beam()

CARTA::Beam Message::Beam ( int32_t  channel,
int32_t  stokes,
float  major_axis,
float  minor_axis,
float  pa 
)
static
Here is the caller graph for this function:

◆ CloseFile()

CARTA::CloseFile Message::CloseFile ( int32_t  file_id)
static
Here is the caller graph for this function:

◆ ConcatStokesFiles()

CARTA::ConcatStokesFiles Message::ConcatStokesFiles ( int32_t  file_id,
const google::protobuf::RepeatedPtrField< CARTA::StokesFile > &  stokes_files 
)
static
Here is the caller graph for this function:

◆ ContourImageData()

CARTA::ContourImageData Message::ContourImageData ( int32_t  file_id,
uint32_t  reference_file_id,
int32_t  channel,
int32_t  stokes,
double  progress 
)
static
Here is the caller graph for this function:

◆ DecodeMessage()

template<typename T >
T Message::DecodeMessage ( std::string_view  sv_message)
static

Decodes a message from a buffer of characters into an object of type T and can be used to decode various types of messages.

Template Parameters
TThe type of the object to decode the message into. T must have a member function ParseFromArray(const void*, int) to parse the data.
Parameters
sv_messageThe message to decode.
Exceptions
std::runtime_errorIf the message cannot be parsed.
Returns
The decoded message of type T.
Note
This function uses a static_assert to ensure that T has a member function ParseFromArray. If T does not have this member function, a compilation error will occur. The function also throws a parsing exception if the parsing fails.

◆ DoublePoint()

CARTA::DoublePoint Message::DoublePoint ( double  x,
double  y 
)
static
Here is the caller graph for this function:

◆ EncodeMessage()

std::vector< char > Message::EncodeMessage ( CARTA::EventType  event_type,
uint32_t  event_id,
const google::protobuf::MessageLite &  message 
)
static

Encodes a protobuf message with a CARTA event header for transmission.

Parameters
event_typeThe CARTA event type to encode in the header.
event_idThe event or request ID to encode in the header.
messageThe protobuf message to serialize and encode.
Returns
A std::vector<char> containing the header followed by the serialized message.
Note
This function creates a binary buffer containing a CARTA::EventHeader followed by the serialized protobuf message. The header includes the event type, protocol version, and event/request ID.
Here is the caller graph for this function:

◆ ErrorData()

CARTA::ErrorData Message::ErrorData ( const std::string &  message,
std::vector< std::string >  tags,
CARTA::ErrorSeverity  severity 
)
static
Here is the caller graph for this function:

◆ FileInfo()

CARTA::FileInfo Message::FileInfo ( const std::string &  name,
CARTA::FileType  type,
int64_t  size = 0,
const std::string &  hdu = "" 
)
static
Here is the caller graph for this function:

◆ FittingProgress()

CARTA::FittingProgress Message::FittingProgress ( int32_t  file_id,
float  progress 
)
static
Here is the caller graph for this function:

◆ GaussianComponent()

CARTA::GaussianComponent Message::GaussianComponent ( const CARTA::DoublePoint &  center,
double  amp,
const CARTA::DoublePoint &  fwhm,
double  pa 
)
static
Here is the caller graph for this function:

◆ GetEventHeader()

carta::EventHeader Message::GetEventHeader ( std::string_view  message)
static
Here is the caller graph for this function:

◆ ImageBounds()

CARTA::ImageBounds Message::ImageBounds ( int32_t  x_min,
int32_t  x_max,
int32_t  y_min,
int32_t  y_max 
)
static
Here is the caller graph for this function:

◆ ImportRegionAck()

CARTA::ImportRegionAck Message::ImportRegionAck ( bool  success,
const std::string &  message 
)
static
Here is the caller graph for this function:

◆ ListProgress()

CARTA::ListProgress Message::ListProgress ( const CARTA::FileListType &  file_list_type,
int32_t  total_count,
int32_t  checked_count,
float  percentage 
)
static
Here is the caller graph for this function:

◆ MomentProgress()

CARTA::MomentProgress Message::MomentProgress ( int32_t  file_id,
float  progress 
)
static
Here is the caller graph for this function:

◆ OpenFile()

CARTA::OpenFile Message::OpenFile ( std::string  directory,
std::string  file,
bool  lel_expr,
std::string  hdu,
int32_t  file_id,
bool  support_aips_beam,
CARTA::RenderMode  render_mode = CARTA::RenderMode::RASTER 
)
static
Here is the caller graph for this function:

◆ Point() [1/4]

CARTA::Point Message::Point ( const casacore::Vector< casacore::Double > &  input,
int  x_index = 0,
int  y_index = 1 
)
static
Here is the call graph for this function:

◆ Point() [2/4]

CARTA::Point Message::Point ( const std::vector< casacore::Quantity > &  input,
int  x_index = 0,
int  y_index = 1 
)
static
Here is the call graph for this function:

◆ Point() [3/4]

CARTA::Point Message::Point ( const std::vector< double > &  input,
int  x_index = 0,
int  y_index = 1 
)
static
Here is the call graph for this function:

◆ Point() [4/4]

CARTA::Point Message::Point ( float  x,
float  y 
)
static
Here is the caller graph for this function:

◆ PvProgress()

CARTA::PvProgress Message::PvProgress ( int32_t  file_id,
float  progress,
int32_t  preview_id = 0 
)
static
Here is the caller graph for this function:

◆ RasterTileData()

CARTA::RasterTileData Message::RasterTileData ( int32_t  file_id,
int32_t  sync_id,
int32_t  animation_id 
)
static
Here is the caller graph for this function:

◆ RasterTileSync()

CARTA::RasterTileSync Message::RasterTileSync ( int32_t  file_id,
int32_t  channel,
int32_t  stokes,
int32_t  sync_id,
int32_t  animation_id,
int32_t  tile_count,
bool  end_sync 
)
static
Here is the caller graph for this function:

◆ RegionHistogramData()

CARTA::RegionHistogramData Message::RegionHistogramData ( int32_t  file_id,
int32_t  region_id,
int32_t  channel,
int32_t  stokes,
float  progress,
const carta::HistogramConfig hist_config 
)
static
Here is the caller graph for this function:

◆ RegionStatsData()

CARTA::RegionStatsData Message::RegionStatsData ( int32_t  file_id,
int32_t  region_id,
int32_t  channel,
int32_t  stokes 
)
static
Here is the caller graph for this function:

◆ RegisterViewerAck()

CARTA::RegisterViewerAck Message::RegisterViewerAck ( uint32_t  session_id,
bool  success,
const std::string &  status,
const CARTA::SessionType &  type 
)
static
Here is the caller graph for this function:

◆ ScriptingRequest()

CARTA::ScriptingRequest Message::ScriptingRequest ( uint32_t  scripting_request_id,
const std::string &  target,
const std::string &  action,
const std::string &  parameters,
bool  async,
const std::string &  return_path 
)
static
Here is the caller graph for this function:

◆ SetDimensions()

CARTA::FileInfoExtended Message::SetDimensions ( CARTA::FileInfoExtended &  response,
int32_t  dimensions,
int32_t  width,
int32_t  height,
int32_t  depth,
int32_t  stokes 
)
static
Here is the caller graph for this function:

◆ SetImageChannels()

CARTA::SetImageChannels Message::SetImageChannels ( int32_t  file_id,
int32_t  channel,
int32_t  stokes,
CARTA::CompressionType  compression_type = CARTA::CompressionType::NONE,
float  compression_quality = -1 
)
static
Here is the caller graph for this function:

◆ SetRegion() [1/2]

CARTA::SetRegion Message::SetRegion ( int32_t  file_id,
int32_t  region_id,
CARTA::RegionType  region_type,
std::vector< CARTA::Point >  control_points,
float  rotation 
)
static
Here is the caller graph for this function:

◆ SetRegion() [2/2]

CARTA::SetRegion Message::SetRegion ( int32_t  file_id,
int32_t  region_id,
const CARTA::RegionInfo &  region_info 
)
static

◆ SetRegionAck()

CARTA::SetRegionAck Message::SetRegionAck ( int32_t  region_id,
bool  success,
std::string  err_message 
)
static
Here is the caller graph for this function:

◆ SpatialProfileData() [1/2]

CARTA::SpatialProfileData Message::SpatialProfileData ( int32_t  file_id,
int32_t  region_id,
int32_t  x,
int32_t  y,
int32_t  channel,
int32_t  stokes,
float  value,
int32_t  start,
int32_t  end,
std::vector< float > &  profile,
std::string &  coordinate,
int32_t  mip,
CARTA::ProfileAxisType  axis_type,
float  crpix,
float  crval,
float  cdelt,
std::string &  unit 
)
static
Here is the caller graph for this function:

◆ SpatialProfileData() [2/2]

CARTA::SpatialProfileData Message::SpatialProfileData ( int32_t  x,
int32_t  y,
int32_t  channel,
int32_t  stokes,
float  value 
)
static

◆ SpectralProfileData() [1/2]

CARTA::SpectralProfileData Message::SpectralProfileData ( int32_t  file_id,
int32_t  region_id,
int32_t  stokes,
float  progress,
std::string &  coordinate,
std::vector< CARTA::StatsType > &  required_stats,
std::map< CARTA::StatsType, std::vector< double > > &  spectral_data 
)
static
Here is the caller graph for this function:

◆ SpectralProfileData() [2/2]

CARTA::SpectralProfileData Message::SpectralProfileData ( int32_t  stokes,
float  progress 
)
static

◆ StartAnimationAck()

CARTA::StartAnimationAck Message::StartAnimationAck ( bool  success,
int32_t  animation_id,
const std::string &  message 
)
static
Here is the caller graph for this function:

◆ VectorOverlayTileData()

CARTA::VectorOverlayTileData Message::VectorOverlayTileData ( int32_t  file_id,
int32_t  channel,
int32_t  stokes_intensity,
int32_t  stokes_angle,
const CARTA::CompressionType &  compression_type,
float  compression_quality 
)
static
Here is the caller graph for this function:

The documentation for this class was generated from the following files: