Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::internal::MatchMatrix Class Reference

#include <gmock-matchers.h>

Public Member Functions

 MatchMatrix (size_t num_elements, size_t num_matchers)
 
size_t LhsSize () const
 
size_t RhsSize () const
 
bool HasEdge (size_t ilhs, size_t irhs) const
 
void SetEdge (size_t ilhs, size_t irhs, bool b)
 
bool NextGraph ()
 
void Randomize ()
 
std::string DebugString () const
 

Detailed Description

Definition at line 3609 of file gmock-matchers.h.

Constructor & Destructor Documentation

◆ MatchMatrix()

testing::internal::MatchMatrix::MatchMatrix ( size_t num_elements,
size_t num_matchers )
inline

Definition at line 3611 of file gmock-matchers.h.

3612 : num_elements_(num_elements),
3613 num_matchers_(num_matchers),
3614 matched_(num_elements_* num_matchers_, 0) {
3615 }

Member Function Documentation

◆ DebugString()

std::string testing::internal::MatchMatrix::DebugString ( ) const

Definition at line 381 of file gmock-matchers.cc.

381 {
382 ::std::stringstream ss;
383 const char* sep = "";
384 for (size_t i = 0; i < LhsSize(); ++i) {
385 ss << sep;
386 for (size_t j = 0; j < RhsSize(); ++j) {
387 ss << HasEdge(i, j);
388 }
389 sep = ";";
390 }
391 return ss.str();
392}
bool HasEdge(size_t ilhs, size_t irhs) const
static const Segment ss(Segment::ss)
uint16_t j
Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasEdge()

bool testing::internal::MatchMatrix::HasEdge ( size_t ilhs,
size_t irhs ) const
inline

Definition at line 3619 of file gmock-matchers.h.

3619 {
3620 return matched_[SpaceIndex(ilhs, irhs)] == 1;
3621 }
Here is the caller graph for this function:

◆ LhsSize()

size_t testing::internal::MatchMatrix::LhsSize ( ) const
inline

Definition at line 3617 of file gmock-matchers.h.

3617{ return num_elements_; }
Here is the caller graph for this function:

◆ NextGraph()

bool testing::internal::MatchMatrix::NextGraph ( )

Definition at line 358 of file gmock-matchers.cc.

358 {
359 for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {
360 for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {
361 char& b = matched_[SpaceIndex(ilhs, irhs)];
362 if (!b) {
363 b = 1;
364 return true;
365 }
366 b = 0;
367 }
368 }
369 return false;
370}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Randomize()

void testing::internal::MatchMatrix::Randomize ( )

Definition at line 372 of file gmock-matchers.cc.

372 {
373 for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {
374 for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {
375 char& b = matched_[SpaceIndex(ilhs, irhs)];
376 b = static_cast<char>(rand() & 1); // NOLINT
377 }
378 }
379}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RhsSize()

size_t testing::internal::MatchMatrix::RhsSize ( ) const
inline

Definition at line 3618 of file gmock-matchers.h.

3618{ return num_matchers_; }
Here is the caller graph for this function:

◆ SetEdge()

void testing::internal::MatchMatrix::SetEdge ( size_t ilhs,
size_t irhs,
bool b )
inline

Definition at line 3622 of file gmock-matchers.h.

3622 {
3623 matched_[SpaceIndex(ilhs, irhs)] = b ? 1 : 0;
3624 }
Here is the caller graph for this function:

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