Will this implementation of a compute shader work

OK so I haven’t found anywhere a complete tutorial on this, I mean Compute Shaders. Actually I think that when I am done with part of my project I will post it and make a lot of people happy. So I have never successfully done this. I have some questions off the bat ‘In ComputeMesh how do I unbind both of my buffers?’ , ‘In ComputeShader will the method glGetUniformLocation(ID, name); return the uniform location?’ , ‘What should I do to clean up the buffers when I am done with them?’ and ‘In ComputeMesh when do I get the results?’ I have put some comments in my code.

this is my compute shader

#version 430 core
layout(local_sixe_x = 32, local_size_y = 1, local_size_z = 1) in;

layout(std430, binding = 0) buffer input_layout
{
	vec4 position;
	vec4 bweight;
	ivec4 bindex;
}

layout(std430, binding = 1) buffer output_layout
{
	vec4 outPosition;
}


layout(location = 0) uniform mat4 uscale;
layout(location = 1) uniform uint numVerts;
layout(location = 2) uniform mat4 model
layout(location = 3) uniform mat4 boneMatrices[100];

void main(){
	const uint idx = gl_GlobalInvocationID.x;
	if (idx < numVerts){
		bool applyScale = false;
		vec4 totalPosition = vec4(0.0f);
        for(int i = 0 ; i < 4 ; i++)
        {
            if(bindex[i] == -1) 
                continue;
            if(bindex[i] >= 100) 
            {
                totalPosition = vec4(position, 1.0f);
                break;
            }
            vec4 localPosition = finalBonesMatrices[bindex[i]] * vec4(position,1.0f);
            totalPosition += localPosition * bweight[i];
            applyScale = true;
        }
        mat4 tmodel;
        if (applyScale){
            tmodel = model * uscale;
        }else{
            tmodel = model;
            totalPosition = vec4(position,1.0f);
        }
        vec4 outposv = tmodel * totalPosition;
        vec3 ndc = outposv.xyz / outposv.w;
        outPosition[idx] = vec4(ndc, 0);
	}
}

ComputeMesh.h

#pragma once
#include "animvert.h"
#define GLEW_STATIC
#include "GL/glew.h"
#include <vector>
struct compVert {
	float pos[4];	
	float weights[4];
	int boneIDs[4];
};
using namespace std;
class ComputeMesh
{
public:
	~ComputeMesh();
	void bind();
	void load(vector<AnimVertex> verts);
	void getResults();
	void init();
	vector<float[4]> verto;
private:	
	unsigned int vertcnt = 0;
	GLuint ssbo;
	GLuint ssbo1;
	vector<compVert> lverts;	
};

ComputeMesh.cpp

#include "ComputeMesh.h"

ComputeMesh::~ComputeMesh()
{
	//what is the cleanup code here
}

void ComputeMesh::bind()
{
	glBindBuffer(GL_SHADER_STORAGE_BUFFER, ssbo);
	glBindBuffer(GL_SHADER_STORAGE_BUFFER, ssbo1);	
}


void ComputeMesh::load(vector<AnimVertex> verts)
{
	compVert vert;
	float stor[4];
	for (int i = 0; i < 4; i++) stor[i] = 0;
	for (int i = 0; i < verts.size(); i++) {		
		for (int j = 0; j < 4; j++) {
			vert.pos[j] = j < 3 ? verts.at(i).position[j] : 1;
			vert.weights[j] = verts.at(i).m_Weights[j];
			vert.boneIDs[j] = verts.at(i).m_BoneIDs[j];
			lverts.push_back(vert);			
		}
		verto.push_back(stor);
	}
}

void ComputeMesh::getResults()
{
	//when is this called?
	glGetBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, verto.size() * 4 * sizeof(float), (GLvoid*)&verto[0]);
}

void ComputeMesh::init()
{
	//this is what I want to send to the compute shader
	glCreateBuffers(1, &ssbo);
	glNamedBufferStorage(ssbo,
		sizeof(compVert) * lverts.size(),
		(const void*)lverts.data(),
		GL_MAP_READ_BIT);
	glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, ssbo);
	glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);	

	//this is what I want to get back
	glCreateBuffers(1, &ssbo1);
	glNamedBufferStorage(ssbo1, //this stuff I am unsure of
		sizeof(float) * 4 * verto.size(),
		(const void*)verto.data(),
		GL_MAP_WRITE_BIT);
	glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, ssbo1);
	glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
}

ComputeShader.h

#pragma once
#include <string>
#include <map>
#define GLEW_STATIC
#include "GL/glew.h"
#include "glm/glm.hpp"

enum ShaderTypeC {
	COMPUTE,
	PROGRAM
};
using namespace std;
class ComputeShader
{
public:
	void LoadShader(const char* path);
	void use();
	void run();
	void setNum(int num);
	void setUniform(const GLchar* name, const glm::vec2& v);
	void setUniform(const GLchar* name, const glm::vec3& v);
	void setUniform(const GLchar* name, const glm::vec4& v);
	void setUniform(const GLchar* name, const glm::mat4& m);
	void setUniform(string name, const glm::mat4& m);
	void setUniform(const GLchar* name, const GLfloat& m);
	void setUniformSampler(const GLchar* name, const GLint slot);
private:
	string fileToString(const string& filename);
	void  checkCompileErrors(GLuint shader, ShaderTypeC type);
	GLint getUniformLocation(const GLchar* name);
	GLuint ID;
	std::map<string, GLint> mUniformLocations;
	int numVerts;
	unsigned int ID;
};

ComputeShader.cpp

#include "ComputeShader.h"

#include <fstream>
#include <iostream>
#include <sstream>

#include <glm/gtc/type_ptr.hpp>
void ComputeShader::LoadShader(const char* path)
{
	string csString = fileToString(path);
	
	const GLchar* csSourcePtr = csString.c_str();
	
	unsigned int compute;
	// compute shader
	compute = glCreateShader(GL_COMPUTE_SHADER);
	glShaderSource(compute, 1, &csSourcePtr, NULL);
	glCompileShader(compute);
	checkCompileErrors(compute, COMPUTE);

	// shader Program
	ID = glCreateProgram();
	glAttachShader(ID, compute);
	glLinkProgram(ID);
	checkCompileErrors(ID, PROGRAM);
}

void ComputeShader::use()
{
	glUseProgram(ID);
}

void ComputeShader::run()
{
	glDispatchCompute(ceil((float)numVerts / 32), 1, 1);
	glMemoryBarrier(GL_ALL_BARRIER_BITS);
}

void ComputeShader::setNum(int num)
{
	numVerts = num;
}

void ComputeShader::setUniform(const GLchar* name, const glm::vec2& v)
{
	GLint loc = getUniformLocation(name);
	glUniform2f(loc, v.x, v.y);
}

void ComputeShader::setUniform(const GLchar* name, const glm::vec3& v)
{
	GLint loc = getUniformLocation(name);
	glUniform3f(loc, v.x, v.y, v.z);
}

void ComputeShader::setUniform(const GLchar* name, const glm::vec4& v)
{
	GLint loc = getUniformLocation(name);
	glUniform4f(loc, v.x, v.y, v.z, v.w);
}

void ComputeShader::setUniform(const GLchar* name, const glm::mat4& m)
{
	GLint loc = getUniformLocation(name);

	// loc = location of uniform in shader
	// count = how many matrices (1 if not an array of mats)
	// transpose = False for opengl because column major
	// value = the matrix to set for the uniform
	glUniformMatrix4fv(loc, 1, GL_FALSE, glm::value_ptr(m));
}

void ComputeShader::setUniform(string name, const glm::mat4& m)
{
	setUniform(name.c_str(), m);
}

void ComputeShader::setUniform(const GLchar* name, const GLfloat& m)
{
	GLint loc = getUniformLocation(name);
	glUniform1f(loc, m);
}

void ComputeShader::setUniformSampler(const GLchar* name, const GLint slot)
{
	glActiveTexture(GL_TEXTURE0 + slot);
	GLint loc = getUniformLocation(name);
	glUniform1i(loc, slot);
}

string ComputeShader::fileToString(const string& filename)
{
	std::stringstream ss;
	std::ifstream file;

	try
	{
		file.open(filename, std::ios::in);

		if (!file.fail())
		{
			// Using a std::stringstream is easier than looping through each line of the file
			ss << file.rdbuf();
		}

		file.close();
	}
	catch (std::exception ex)
	{
		std::cerr << "Error reading shader filename!" << std::endl;
	}

	return ss.str();
}

void ComputeShader::checkCompileErrors(GLuint shader, ShaderTypeC type)
{
	int status = 0;

	if (type == PROGRAM)
	{
		glGetProgramiv(shader, GL_LINK_STATUS, &status);
		if (status == GL_FALSE)
		{
			GLint length = 0;
			glGetProgramiv(shader, GL_INFO_LOG_LENGTH, &length);

			// The length includes the NULL character
			string errorLog(length, ' ');	// Resize and fill with space character
			glGetProgramInfoLog(shader, length, &length, &errorLog[0]);
			std::cerr << "Error! Shader program failed to link. " << errorLog << std::endl;
		}
	}
	else
	{
		glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
		if (status == GL_FALSE)
		{
			GLint length = 0;
			glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);

			// The length includes the NULL character
			string errorLog(length, ' ');  // Resize and fill with space character
			glGetShaderInfoLog(shader, length, &length, &errorLog[0]);
			std::cerr << "Error! Shader failed to compile. " << errorLog << std::endl;
		}
	}
}

GLint ComputeShader::getUniformLocation(const GLchar* name){
	std::map<string, GLint>::iterator it = mUniformLocations.find(name);
	// Only need to query the shader program IF it doesn't already exist.
	if (it == mUniformLocations.end())
	{
		// Find it and add it to the map
		mUniformLocations[name] = glGetUniformLocation(ID, name);
	}
	// Return it
	return mUniformLocations[name];
}