Ejemplo n.º 1
0
 std::string ABST::toPrettyString(uint32_t indent) {
   std::stringstream r;
   r << std::string(indent, ' ') << "[abst] Bootstrap Info (" << boxedSize() << ")" << std::endl;
   r << std::string(indent + 1, ' ') << "Version " << (int)getVersion() << std::endl;
   r << std::string(indent + 1, ' ') << "BootstrapinfoVersion " << getBootstrapinfoVersion() << std::endl;
   r << std::string(indent + 1, ' ') << "Profile " << (int)getProfile() << std::endl;
   if (getLive()) {
     r << std::string(indent + 1, ' ') << "Live" << std::endl;
   } else {
     r << std::string(indent + 1, ' ') << "Recorded" << std::endl;
   }
   if (getUpdate()) {
     r << std::string(indent + 1, ' ') << "Update" << std::endl;
   } else {
     r << std::string(indent + 1, ' ') << "Replacement or new table" << std::endl;
   }
   r << std::string(indent + 1, ' ') << "Timescale " << getTimeScale() << std::endl;
   r << std::string(indent + 1, ' ') << "CurrMediaTime " << getCurrentMediaTime() << std::endl;
   r << std::string(indent + 1, ' ') << "SmpteTimeCodeOffset " << getSmpteTimeCodeOffset() << std::endl;
   r << std::string(indent + 1, ' ') << "MovieIdentifier " << getMovieIdentifier() << std::endl;
   r << std::string(indent + 1, ' ') << "ServerEntryTable (" << getServerEntryCount() << ")" << std::endl;
   for (unsigned int i = 0; i < getServerEntryCount(); i++) {
     r << std::string(indent + 2, ' ') << i << ": " << getServerEntry(i) << std::endl;
   }
   r << std::string(indent + 1, ' ') << "QualityEntryTable (" << getQualityEntryCount() << ")" << std::endl;
   for (unsigned int i = 0; i < getQualityEntryCount(); i++) {
     r << std::string(indent + 2, ' ') << i << ": " << getQualityEntry(i) << std::endl;
   }
   r << std::string(indent + 1, ' ') << "DrmData " << getDrmData() << std::endl;
   r << std::string(indent + 1, ' ') << "MetaData " << getMetaData() << std::endl;
   r << std::string(indent + 1, ' ') << "SegmentRunTableEntries (" << getSegmentRunTableCount() << ")" << std::endl;
   for (uint32_t i = 0; i < getSegmentRunTableCount(); i++) {
     r << ((Box)getSegmentRunTable(i)).toPrettyString(indent + 2);
   }
   r << std::string(indent + 1, ' ') + "FragmentRunTableEntries (" << getFragmentRunTableCount() << ")" << std::endl;
   for (uint32_t i = 0; i < getFragmentRunTableCount(); i++) {
     r << ((Box)getFragmentRunTable(i)).toPrettyString(indent + 2);
   }
   return r.str();
 }
Ejemplo n.º 2
0
	//value 2 means change live to dead, value 3 means change dead to live
	void gameOfLife(vector<vector<int>>& board) {
		int n = board.size();
		if (n == 0)return;
		int m = board[0].size();
		int count = 0;
		for (int i = 0; i< n; i++){
			for (int j = 0; j<m; j++){
				count = getLive(board, i, j);
				if (board[i][j] == 1){
					if (count < 2 || count >3)board[i][j] = 2;
				}
				else{
					if (count == 3)board[i][j] = 3;
				}
			}

		}
		for (int i = 0; i<n; i++){
			for (int j = 0; j< m; j++){
				if (board[i][j] == 2)board[i][j] = 0;
				else if (board[i][j] == 3)board[i][j] = 1;
			}
		}
	}